f | first = input() | f | first = input() |
| second = input() | | second = input() |
| max_step = len(first) | | max_step = len(first) |
| # print(max_step) | | # print(max_step) |
| result = 0 | | result = 0 |
| starts = [i for i, e in enumerate(first) if e == second[0]] | | starts = [i for i, e in enumerate(first) if e == second[0]] |
| # print(starts) | | # print(starts) |
| for step in range(1, max_step+1): | | for step in range(1, max_step+1): |
| # print(step) | | # print(step) |
| for s in starts: | | for s in starts: |
| area = first[s:len(first):step] | | area = first[s:len(first):step] |
| #print(step, len(area),area[0],area[-1]) | | #print(step, len(area),area[0],area[-1]) |
| if second in area: | | if second in area: |
| result = 1 | | result = 1 |
t | | t | if result: |
| break | | break |
| if result: | | if result: |
| break | | break |
| if result: | | if result: |
| print('YES') | | print('YES') |
| else: | | else: |
| print('NO') | | print('NO') |
| | | |