HiddenText/Stephan
HiddenText/yervandsargsyan
n1x = input()n1first = input()
2y = input()2second = input()
3z = False3isit = False
44
n5if len(y) > len(x):n5if len(second) > len(first):
6    print("NO")6    print("NO")
n7elif len(y) == 0:n7elif len(second) == 0:
8    print("YES")8    print("YES")
n9elif len(y) == 1:n9elif len(second) == 1:
10    if y in x:10    if second in first:
11        print("YES")11        print("YES")
12    else:12    else:
13        print("NO")13        print("NO")
14else:14else:
n15    for i in range(len(x)):n15    for i in range(len(first)):
16        if z:16        if isit:
17            break17            break
nn18        #if first[i]==second[0]: print(first[i], second[0])
18        if x[i] == y[0]:19        if first[i] == second[0]:
19            for k in range(i+1, len(x)):20            for j in range(i+1, len(first)):
21                # print(j)
20                if z:22                if isit:
21                    break23                    break
n22                if x[k] == y[1]:n24                if first[j] == second[1]:
25                    # print("AAA")
23                    j = k-i26                    k = j-i
27                    third = first[i:i+k*(len(second)):k]
28                    if third == second:
29                        isit = True
30    if isit:
31        print("YES")
32    else:
33        print("NO")
2434
t25                    p = x[i:i+j*(len(y)):j]t
26 
27                    if p == y:
28                        z = True
29 
30    if z:
31        print('YES')
32    else:
33        print('NO')
34 
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op