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