qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-

s = list(input())
t = list(input())

ans = False

for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

if ans:
    print("Yes")
else:
    print("No")


Fixed code:

# -*- coding: utf-8 -*-

s = list(input())
t = list(input())

ans = False

for i in range(len(s)):
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

if ans:
    print("Yes")
else:
    print("No")
Buggy code:
import sys

l = list(input())
s = list(input())

for i in range(len(l)):
    if l == s:
        print("Yes")
        sys.exit(0)
    l = l[1:]+list(l[0])
    print(l)
print("No")


Fixed code:
import sys

l = list(input())
s = list(input())

for i in range(len(l)):
    if l == s:
        print("Yes")
        sys.exit(0)
    l = l[1:]+list(l[0])
print("No")
Buggy code:
S = input()
T = input()
flag = False
tmp_S = S

for i in range(len(S)):
  tmp_S = tmp_S[-1]+tmp_S[:-1]
  print(tmp_S)
  if tmp_S == T:
    flag = True

if flag:
  print('Yes')
else:
  print('No')

Fixed code:
S = input()
T = input()
flag = False
tmp_S = S

for i in range(len(S)):
  tmp_S = tmp_S[-1]+tmp_S[:-1]
  if tmp_S == T:
    flag = True

if flag:
  print('Yes')
else:
  print('No')
Buggy code:
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

if s == t:
    print("Yes")

ans = ans(s,t)

print(ans)

Fixed code:
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

ans = ans(s,t)

print(ans)
Buggy code:
S=input()
T=input()
for i in range(len(S)):
    if S[i]==T[0]:
        new_s=S[i:]+S[:i]
         if new_s==T:
             print("Yes")
             exit()

print("No")

Fixed code:
S = input()
T = input()
for i in range(len(S)):
    if S[i] == T[0]:
        new_s = S[i:] + S[:i]
        if new_s == T:
            print("Yes")
            exit()
print("No")
Buggy code:
s=input()
t=input()
for i in range(200):
  s=s[-1]+s[:-1]
  if s==t:print("Yes")
print("No")

Fixed code:
s=input()
t=input()
for i in range(200):
  s=s[-1]+s[:-1]
  if s==t:print("Yes");exit()
print("No")
Buggy code:
s = input()
t = input()
s1 = list(s)
t1 = list(t)
ls = len(s1)
ls1=ls-1
lt = len(t1)
z=0
if s1 == t1:
	print("Yes")
elif s1!=t1:
    for i in range(ls-1):
        x = s1[0]
        y = s1[ls1]
        del s1[ls1]
        s1.insert(0,y)
        if s1 == t1:
            print("Yes")
            z = 1
if z == 0:
    print("No")


Fixed code:
s = input()
t = input()
s1 = list(s)
t1 = list(t)
ls = len(s1)
ls1=ls-1
lt = len(t1)
z=0
if s1 == t1:
	z = 1
elif s1!=t1:
    for i in range(ls-1):
        x = s1[0]
        y = s1[ls1]
        del s1[ls1]
        s1.insert(0,y)
        if s1 == t1:
            z = 1
if z == 0:
    print("No")
else:
  print("Yes")
Buggy code:
A = input()
B = input()
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')

Fixed code:
A = input()
B = input()
t = False
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')
Buggy code:
s=input()
t=input()
if t in [s[i:]+s[:i] for i in range(len(s)]:
	print('Yes')
else:
	print('No')

Fixed code:
s=input()
t=input()
if t in [s[i:]+s[:i] for i in range(len(s))]:
	print('Yes')
else:
	print('No')
Buggy code:
s = input()
t = input()
ans = False
#tests = s
for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    s = s[-1] + s[0 : len(s) - 1]

if ans:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
t = input()
ans = False
#tests = s
for i in range(len(s)):
    #print(s)
    if s == t:
        ans = True
        break
    s = s[-1] + s[0 : len(s) - 1]

if ans:
    print("Yes")
else:
    print("No")
Buggy code:
import sys

s = input()
t = input()

temp = ''
for i in range(len(s)):
    temp += s[-1]
    temp += s[0:len(s)-1]
    print(temp)
    if temp == t:
#        print('Yes')
        sys.exit()
    else:
        s = temp
        temp = ''

print('No')

Fixed code:
import sys

s = input()
t = input()

temp = ''
for i in range(len(s)):
    temp += s[-1]
    temp += s[0:len(s)-1]
    if temp == t:
        print('Yes')
        sys.exit()
    else:
        s = temp
        temp = ''

print('No')
Buggy code:
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    break
if b==False:
  print("No")

Fixed code:
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    b=True
    break
if b==False:
  print("No")
Buggy code:
s = str(input())
t = str(input())
k = False
for i in range(len(s)):
  s = s[-i] + s[:-i]
  if s == t:
    k = True
    break
    
print('Yes' if k else 'No')

Fixed code:
s = str(input())
t = str(input())
k = False
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    k = True
    break
    
print('Yes' if k else 'No')
Buggy code:
s = str(input())
t = str(input())

Z =False

if i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
        Z =True
        exit()
        
print('Yes' if Z else 'No')

Fixed code:
s = str(input())
t = str(input())

Z =False
for i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
        Z =True
        
print('Yes' if Z else 'No')
Buggy code:
s = input()
t = input()
if s == t:
    print('Yes')
    exit()
    
s_num=len(s)
for i in range(s_num):
    s = s[-1] + s[: s_num - 1]
    if s == t:
        print('Yes')
print('No')


Fixed code:
s = input()
t = input()
if s == t:
    print('Yes')
    exit()

s_num=len(s)
for i in range(s_num):
    s = s[-1] + s[: s_num - 1]
    if s == t:
        print('Yes')
        exit()
print('No')
Buggy code:
s = input()
t = input()

for i in range(100):
    a = 0
    s = s[-1:] + s[:-1]
    if s == t:
        a += 1
if a == 1:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
t = input()
a = 0
for i in range(100):
    s = s[-1:] + s[:-1]
    if s == t:
        a = 1
if a == 1:
    print("Yes")
else:
    print("No")
Buggy code:
a=input()
t=input()
for i in range(len(a)):
  S=a[-i:]+a[:-i]
  if S==t:
    print("YES")
    break
else:
  print("No")

Fixed code:
a=input()
t=input()
for i in range(len(a)):
  S=a[-i:]+a[:-i]
  if S==t:
    print("Yes")
    break
else:
  print("No")
Buggy code:
s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s = t:
    c = 0
print('YNeos'[c::2])

Fixed code:
s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    c = 0
print('YNeos'[c::2])
Buggy code:
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    #print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")
Buggy code:
S = input()
T = input()
f = False

for i in range(len(S)):
  if S[:i]+S[i:]==T:
    f = True

if f:
  print("Yes")
else:
  print("No")


Fixed code:
S = input()
T = input()
f = False

for i in range(len(S)):
  if S[i:]+S[:i]==T:
    f = True

if f:
  print("Yes")
else:
  print("No")
Buggy code:
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == Si[i:] + S1[:i]:
    ok = "Yes"
print(ok)

Fixed code:
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == S1[i:] + S1[:i]:
    ok = "Yes"
print(ok)
Buggy code:
import sys

s = input()
t = input()

sLen = len(s)

for i in range(sLen):
    sRote = s[1:sLen] + s[0]
    s = sRote
    print(s)
    if s == t :
        #print("Yes")
        sys.exit()

print("No")

Fixed code:
import sys

s = input()
t = input()

sLen = len(s)

for i in range(sLen):
    sRote = s[1:sLen] + s[0]
    s = sRote
    #print(s)
    if s == t :
        print("Yes")
        sys.exit()

print("No")
Buggy code:
s = list(input())
t = input()
ans = "No"
for i in range(len(s)):
    s.append(s.pop(0))
    print(s)
    if "".join(s)==t:
        ans = "Yes"
print(ans)

Fixed code:
s = list(input())
t = input()
ans = "No"
for i in range(len(s)):
    s.append(s.pop(0))
    if "".join(s)==t:
        ans = "Yes"
print(ans)
Buggy code:
S = input()
T = input()

lengt = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

Fixed code:
S = input()
T = input()

length = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')
Buggy code:
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        del s[0]
        s = s + tmp
print("No")

Fixed code:
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        s = s[1:] + tmp
print("No")
Buggy code:

def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
        print(S)
    else:
        print("No")

Fixed code:
def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
    else:
        print("No")
Buggy code:
a=list(input())
b=list(input())
hantei=True
for i in range(len(a)):
	c=[]
	c.append(a[-1])
	for i in range(0,len(a)-1):
		c.append(a[i])
	a=c
	if c==b:
		hantei=True
		break
	else:
		hantei=False

if hantei==False:
	print("No")
else:
	print("Yesk")


Fixed code:
a=list(input())
b=list(input())
hantei=True
for i in range(len(a)):
	c=[]
	c.append(a[-1])
	for i in range(0,len(a)-1):
		c.append(a[i])
	a=c
	if c==b:
		hantei=True
		break
	else:
		hantei=False

if hantei==False:
	print("No")
else:
	print("Yes")
Buggy code:
S = list(input())
T = list(input())
cnt = 0
for i in range(len(S)):
    L = S[-i-1:] + S[0:-i-1]
    if L == T:
        cnt += 1
if cnt != 0:
    print('Yes')
else:
    print('NO')

Fixed code:
S = list(input())
T = list(input())
cnt = 0
for i in range(len(S)):
    L = S[-i-1:] + S[0:-i-1]
    if L == T:
        cnt += 1
if cnt != 0:
    print('Yes')
else:
    print('No')
Buggy code:
import sys
S = list(input())
T = list(input())
for i in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit(0)
    l = S[1:] + list(l[0])
print("No")

Fixed code:
import sys
S = list(input())
T = list(input())

for i in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit(0)
    S = S[1:] + list(S[0])
print("No")
Buggy code:
ans = []
a,b = input(),input()
for _ in range(len(a)):
    st =  a[(len(a)-1)-_:]+a[:((len(a)-1)-_)]
    ans.append(st)
print("Yes"if b in ans else "NO")

Fixed code:
ans = []
a,b = input(),input()
for _ in range(len(a)):
    st =  a[(len(a)-1)-_:]+a[:((len(a)-1)-_)]
    ans.append(st)
print("Yes"if b in ans else "No")
Buggy code:
S = input()
T = input()

success = 0

for i in range(len(S)):
    if S[i:] + S[:i]:
        success += 1

if success >= 1:
    print('Yes')
else:
    print('No')

Fixed code:
S = input()
T = input()

success = 0

for i in range(len(S)):
    if S[i:] + S[:i] == T:
        success += 1

if success >= 1:
    print('Yes')
else:
    print('No')
Buggy code:
S = input()
T = input()

for i in range(len(T)):
  s = T[i:]+T[:i]
  if s == T:
    print('Yes')
    exit()
print('No')

Fixed code:
S = input()
T = input()

for i in range(len(T)):
  spinedT = T[i:]+T[:i]
  if spinedT == S:
    print('Yes')
    exit()
print('No')
Buggy code:
s = str(input())
n = str(input())
ans = 0
for i in range(len(s)):
    s = s[1:] + s[0]
    if s == n:
        ans = 1
        break-

if ans == 1:
    print("Yes")
else:
    print("No")


Fixed code:
s = str(input())
n = str(input())
ans = 0
for i in range(len(s)):
    s = s[1:] + s[0]
    if s == n:
        ans = 1
        break

if ans == 1:
    print("Yes")
else:
    print("No")
Buggy code:
import sys
from sys import stdin
s = list(stdin.readline().rstrip())
t = list(stdin.readline().rstrip())
for i in range(len(s)):
    s=list(s[-1])+s[:len(s)-1]
    print(s)
    if s==t:
        print('Yes')
        sys.exit()
print('No')


Fixed code:
import sys
from sys import stdin
s = list(stdin.readline().rstrip())
t = list(stdin.readline().rstrip())
for i in range(len(s)):
    s=list(s[-1])+s[:len(s)-1]
    if s==t:
        print('Yes')
        sys.exit()
print('No')
Buggy code:
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
N = len(S)
for i in range(N):
    S = S[-1] + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")

Fixed code:
import sys
input = sys.stdin.readline
S = list(input().rstrip())
T = list(input().rstrip())
N = len(S)
for i in range(N):
    S = list(S[-1]) + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")
Buggy code:
s = input()
t = input()

for i in range(len(s)):
    s = s[-1] + s[:-1]
    print(s, t)
    if s == t:
        print("Yes")
        break
else:
    print("No")


Fixed code:
s = input()
t = input()

for i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
        print("Yes")
        break
else:
    print("No")
Buggy code:
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")


Fixed code:
s1 = input()
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")
Buggy code:
S = input()
T = input()

for i in range(len(S)):
    last = S[-1]
    S = last + S[:-1]
    if S == T:
        print('Yes')
        break
else:
    print('NO')

Fixed code:
S = input()
T = input()

for i in range(len(S)):
    last = S[-1]
    S = last + S[:-1]
    if S == T:
        print('Yes')
        break
else:
    print('No')
Buggy code:
def rotate(argstr):
    return argstr[len(argstr)-1] + argstr[0:len(argstr)-1]

str1 = "cat"
str2 = "tca"
ans = 'No'

if str1 == str2: ans = 'Yes'

for i in range(0, len(str1) - 1):
    str1 = rotate(str1)
    if str1 == str2: ans = 'Yes'

print(ans)

Fixed code:
def rotate(argstr):
    return argstr[len(argstr)-1] + argstr[0:len(argstr)-1]

str1 = input()
str2 = input()
ans = 'No'

if str1 == str2: ans = 'Yes'

for i in range(0, len(str1) - 1):
    str1 = rotate(str1)
    if str1 == str2: ans = 'Yes'

print(ans)
Buggy code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    T = input()

    l = len(S)
    
    def judge():
        for i in range(1, l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False
    
    if judge():
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()


Fixed code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    T = input()

    l = len(S)

    def judge():
        for i in range(l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False

    if judge():
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Buggy code:
S=input()
T=input()

for i in range(len(S)):
    S=S[-1]+S[:-1]
    if T==S:
        print('Yes')
        exit()
    print(S)
print('No')

Fixed code:
S=input()
T=input()

for i in range(len(S)):
    S=S[-1]+S[:-1]
    if T==S:
        print('Yes')
        exit()

print('No')
Buggy code:
S = input()
T = input()

L = len(S)

bl = False
bl = [True for i in range(L) if S[i:] == T[:L-i] and S[:i] == T[L-i:]:]

answer = 'Yes' if bl else 'No'
print(answer)

Fixed code:
S = input()
T = input()

L = len(S)

bl = False
for i in range(L):
  if S[i:] == T[:L-i] and S[:i] == T[L-i:]:
    bl = True

answer = 'Yes' if bl else 'No'
print(answer)
Buggy code:
ANS='No'
S=input()
T=input()
N=len(S)
for i in range(S):
  if S[i:N] + S[:i] == T:
    ANS='Yes'
    break
print(ANS)

Fixed code:
ANS='No'
S=input()
T=input()
N=len(S)
for i in range(N):
  if S[i:N] + S[:i] == T:
    ANS='Yes'
    break
print(ANS)
Buggy code:
s=input()
t=input()

for i in range(len(s)):
    s=s[-1]+s[:len(s)-1]
    if s==t:
        print('Yes')
        break
    if i==len(s)-1:
        print('NO')

Fixed code:
s=input()
t=input()

for i in range(len(s)):
    s=s[-1]+s[:len(s)-1]
    if s==t:
        print('Yes')
        break
    if i==len(s)-1:
        print('No')
Buggy code:
s, t = input(), input()
for i in range(len(s)):
    if t = s[len(t)-i:]+s[i:len(t)-i]:
        print('Yes')
        break
else:
    print('No')

Fixed code:
s, t = input(), input()
for i in range(len(s)):
    if t == s[len(s)-i:]+s[:len(s)-i]:
        print('Yes')
        break
else:
    print('No')
Buggy code:
# coding: utf-8
str = input()
str2 = input()

str3 = str2*2

if str3.find(str):
    print('Yes')
else:
    print('No')


Fixed code:
# coding: utf-8
str = input()
str2 = input()

str3 = str2*2

if str3.find(str) > -1:
    print('Yes')
else:
    print('No')
Buggy code:
S = input()
T = input()

for i in range(len(S)):
    print(S[i:] + S[:i])
    if T == S[i:] + S[:i]:
        print('Yes')
        exit()
print('No')

Fixed code:
S = input()
T = input()

for i in range(len(S)):
    if T == S[i:] + S[:i]:
        print('Yes')
        exit()
print('No')
Buggy code:
# coding: utf-8
# Your code here!

n = input()
m = input()

d = {}

flag = False

for i in range(len(n)):
    if n[i:] in m and n[i:] in m:
        flag = True
        
        
if flag:
    print("Yes")
else:
    print("No")

Fixed code:
# coding: utf-8
# Your code here!

n = input()
m = input()

d = {}

flag = False

for i in range(len(n)):
    if n[i:]+n[:i] == m:
        flag = True

if flag:
    print("Yes")
else:
    print("No")
Buggy code:
S=input()
T=input()

ans = "No"
for i in range(len(S)):
	if S[:i] + S[0:1] == T:
		ans = "Yes"

print(ans)


Fixed code:
S = input()
T = input()
ans = 'No'
for i in range(len(S)):
  if S == T:
    ans = 'Yes'
    break
  S = S[1:] + S[0]
print(ans)
Buggy code:
s=input()
t=input()

for i in range(len(s)):
      s=s[-1]+s[:-1]
      print(s)
      if s==t:
            print("Yes")
            exit()
print("No")


Fixed code:
s=input()
t=input()

for i in range(len(s)):
      s=s[-1]+s[:-1]
      if s==t:
            print("Yes")
            exit()
print("No")
Buggy code:
s=input()
t=input()
ss=s+s
n=len(s)
for i in range(n):
  if ss[i:]=t:
    print("Yes")
    exit(0)

print("No")


Fixed code:
s=input()
t=input()
ss=s+s
n=len(s)
for i in range(n):
  if ss[i:i+n]==t:
    print("Yes")
    exit(0)

print("No")
Buggy code:
s=input()
t=input()
ss=s+s
if t in s:
  print("Yes")
else:
  print("No")

Fixed code:
s = input()
t = input()

if t in (s+s):
	print("Yes")
else:
	print("No")
Buggy code:
s,t=open(0);print(" YNeos"[t in[s[i:-1]+s[:i]for i in range(99)]::2])

Fixed code:
s,t=open(0);print(" YNeos"[t[:-1]in[s[i:-1]+s[:i]for i in range(99)]::2])
Buggy code:
A=input()
B=input()
if "A" in "B*3":
  print("Yes")
else:
  print("No")

Fixed code:
A=input()
B=input()
if A in B*3:
  print("Yes")
else:
  print("No")
Buggy code:
s = input()
t = input()
n = len(s)
f = False
for i in range(n):
    print(s)
    if s == t:
        f = True
        break
    else:
        s = s[n-1] + s[:n-1] 
if f:
    print("Yes")
else:
    print("No")
        

Fixed code:
s = input()
t = input()
n = len(s)
f = False
for i in range(n):
    if s == t:
        f = True
        break
    else:
        s = s[n-1] + s[:n-1] 
if f:
    print("Yes")
else:
    print("No")
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
t = rr()
for i in range(len(s)+3):
    if s == t:
        print('Yes')
        exit()
    else:
        s = s[-1] + s[:-1]
        












Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
t = rr()
for i in range(len(s)+3):
    if s == t:
        print('Yes')
        exit()
    else:
        s = s[-1] + s[:-1]
print('No')
Buggy code:
s = [str(x) for x in input()]
t = [str(x) for x in input()]

def solve(s_list,t_list,n):
    if n== 120:
        return print("No")
    a = s_list.pop(-1)
    s_list.insert(0,a)
    if s_list ==t_list:
        return print("yes")
    else:
        solve(s,t,n+1)

solve(s,t,0)

Fixed code:
s = [str(x) for x in input()]
t = [str(x) for x in input()]

def solve(s_list,t_list,n):
    if n== 120:
        return print("No")
    a = s_list.pop(-1)
    s_list.insert(0,a)
    if s_list ==t_list:
        return print("Yes")
    else:
        solve(s,t,n+1)

solve(s,t,0)
Buggy code:
S = input()
T = input()

flag = False
for i in range(len(S)):
    T = T[1:] + T[:1]
    print(T)
    if S == T:
        flag = True
        break

print('Yes' if flag else 'No')



Fixed code:
S = input()
T = input()

flag = False
for i in range(len(S)):
    T = T[1:] + T[:1]
    if S == T:
        flag = True
        break

print('Yes' if flag else 'No')
Buggy code:
S = input()
T = input()
ans = 'No'
for i in range(len(S)):
  if S[i:]+S[i] == T:
    ans = 'Yes'
    break
print(ans)

Fixed code:
S = input()
T = input()
ans = 'No'
for i in range(len(S)):
  if S[i:]+S[:i] == T:
    ans = 'Yes'
    break
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print('No')
    break

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]


Fixed code:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]

if s != t:
    print("No")
Buggy code:
a = input()
b = input()

n = len(a)

ans = False

for i in range(1, n - 1):
    if a[i:n] + a[0:i] == b:
        ans = True
        break

print('Yes') if ans else print('No')

Fixed code:
a = input()
b = input()

n = len(a)

ans = False

for i in range(0, n):
    if a[i:n] + a[0:i] == b:
        ans = True
        break

print('Yes') if ans else print('No')
Buggy code:
S = input()
T = input()
count = 0
while S !=T:
    if count > len(S):
        ans = "No"
        break
    else:
        S = S[-1:] + S[:-1]
        ans = "Yes"
        count +=1
print(ans)

Fixed code:
S = input()
T = input()
count = 0
ans = "Yes"
while S !=T:
    if count > len(S):
        ans = "No"
        break
    else:
        S = S[-1:] + S[:-1]
        ans = "Yes"
        count +=1
print(ans)
Buggy code:
S=input()
T=input()

for i in range(100):
  if S[-1-i:-1]+S[0:100-i] ==T:
    print("Yes")
    break
else:
  print("No")

Fixed code:
S=input()
T=input()

for i in range(100):
  if S[-i:]+S[0:len(S)-i] ==T:
    print("Yes")
    break
else:
  print("No")