Problem:
 Score : 200 points    Problem Statement You are given string S and T consisting of lowercase English letters.  Determine if S equals T after rotation .  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|} . Change S to S_{|S|} S_1 S_2 ... S_{|S|-1} .  Here, |X| denotes the length of the string X .      Constraints  2 \leq |S| \leq 100  |S| = |T|  S and T consist of lowercase English letters.         Input Input is given from Standard Input in the following format:  S  T       Output If S equals T after rotation , print Yes ; if it does not, print No .        Sample Input 1 kyoto
tokyo      Sample Output 1 Yes   In the first operation, kyoto becomes okyot .  In the second operation, okyot becomes tokyo .        Sample Input 2 abc
arc      Sample Output 2 No  abc does not equal arc after any number of operations.       Sample Input 3 aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab      Sample Output 3 Yes

Solution (Python):
n = input()
n2 = input()

nl = []
for i in range(len(n)):
    nl.append(n[i:] + n[:i])

if n2 in nl:
    print('Yes')
else:
    print('No')

Solution (Python):
def solve(s, t):
    n = len(s)
    for i in range(n):
        u = s[i:] + s[:i]
        if u == t:
            return "Yes"
    return "No"

assert solve("kyoto","tokyo") == "Yes"
assert solve("abc", "arc") == "No"
assert solve("aaaaaaaaaaaaaaab", "aaaaaaaaaaaaaaab") == "Yes"
s = raw_input()
t = raw_input()
print solve(s, t)

Solution (Python):
s = list(input())
t = list(input())
n = len(s)

for i in range(n):
    x = s[i:n]
    x.extend(s[:i])
    if x == t:
        print("Yes")
        break
else:
    print("No")

Solution (Python):


S = list(input())
T = list(input())

for i in range(len(S)):
    temp = S.pop(-1)
    S.insert(0, temp)
    if S==T:
        print("Yes")
        break
else:
    print("No")

Solution (Python):

import sys

s=raw_input()
t=raw_input()
for i in xrange(len(s)):
 t=t[1:]+t[0]
 if t==s:
  print 'Yes'
  sys.exit()
print 'No'

Solution (Python):
s=input()
t=input()
count=0
ans='No'
while count<len(s):
    if s==t:ans='Yes'
    s=s[-1]+s[:-1]
    count+=1
print(ans)

Solution (Python):
S = input()
T = input()
flag = False
for i in range(len(S)):
    if S[i:] + S[:i] == T:
        flag = True
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input().strip()
T = input().strip()

ans = 'Yes' if T in S+S else 'No'
print(ans)

Solution (Python):
S = input()
T = input()

if S == T:
  print("Yes")
  exit()

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

print("No")

Solution (Python):
a=input()
b=input()
print('Yes' if a in (b*2) else 'No')

Solution (Python):
s = input()
t = input()


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

Solution (Python):
if __name__ == '__main__':
    s = input()
    t = input()
    mod_s = s

    for i in range(len(s)):
        mod_s = mod_s[1:] + mod_s[0]

        if mod_s == t:
            print('Yes')
            exit()

    print('No')

Solution (Python):
S = list(input())
T = list(input())
ans = "No"
for i in range(len(S)):
  if S == T:
    ans = "Yes"
    break
  S.insert(0, S[-1])
  S.pop(-1)
print(ans)

Solution (Python):
s = input()
t = input()
ans = False

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

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

Solution (Python):
s = input()
t = input()

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

Solution (Python):
s = input()
t = input()
s = s + s
if t in s:
    print("Yes")
else:
    print("No")

Solution (Python):
s=list(input())
t=list(input())
for i in range(len(s)):
    s.insert(0,s[len(s)-1])
    s.pop(len(s)-1)
    if s==t:
        print("Yes")
        exit()
else:print("No")

Solution (Python):
s = input()
t = input()

if t in (s+s) :
    print("Yes")
else :
    print("No")

Solution (Python):
s=input()
t=input()
print("Yes") if t in (s+s) else print("No")

Solution (Python):
S = input()
T = input()
assert len(S) == len(T)

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

Solution (Python):
s = input()
t = input()
ans = "No"

for s_index  in range(len(s)):
    for t_index in range(len(t)):
        flag = True
        index = (s_index + t_index) % len(s)
        if s[index] != t[t_index]:
            flag = False
            break
    if flag:
        ans = "Yes"
        break

print(ans)

Solution (Python):
s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    if(s1[i:]+s1[:i] == s2):
        print("Yes")
        break
else:
    print("No")

Solution (Python):
S=str(input())
T=str(input())
L=len(S)
for i in range(L):
    Sr=S[i:]+S[:i]
    if Sr==T:
        print('Yes')
        exit()

print('No')

Solution (Python):
S = input()
T = input()
T2 = T + T
print('Yes' if S in T2 else 'No')

Solution (Python):
S=input()
T=input()
if(len(S)==len(T)):
    length=len(S)
    i=0
    while(i<length):
        if(S==T):
            print('Yes')
            break
        S=S[-1]+S[0:-1]
        i+=1
    if i==length:
        print('No')
else:
    print('No')

Solution (Python):
import sys
def na(): map(int,sys.stdin.readline().split())
def ns(): return sys.stdin.readline().strip()

s=ns()
t=ns()
n=len(s)
for i in range(n):
    if s[n-i:] + s[0:n-i] == t:
        print('Yes')
        exit()
print('No')

Solution (Python):
s = input()
t = input()
for i in range(len(s)):
  if s[i] == t[0]:
    j, k =  i + 1, 1
    while k <= len(t):
      j %= len(s)
      if k == len(s): 
        print('Yes')
        exit(0)
      if s[j] != t[k]: 
        break
      k += 1
      j += 1
print('No')

Solution (Python):
a=input()
b=input()
print('Yes' if a in (b*2) else 'No')

Solution (Python):
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")

Solution (Python):
a=input()
b=input()
print("Yes" if (a+a).find(b) != -1 else "No")

Solution (Python):
s = input()
t = input()

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

Solution (Python):
s1 = input()
s2 = input()


for i in range(len(s1)):
    tmp = s1[i + 1:] + s1[:i + 1]
     
    if tmp == s2:
        print('Yes')
        exit(0)
    
    
print('No')

Solution (Python):
from collections import deque

S = input()
T = input()
N = len(S)

ans = False
QS = deque(list(S))

for _ in range(N):
    QS.appendleft(QS.pop())
    A = ''.join(QS)
    if A == T:
        ans = True
        break

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

Solution (Python):
import numpy as np

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

i = 0
while True:
    s = list(np.roll(s,-1))
    i += 1
    if s == t:
        print("Yes")
        break
    elif i >= len(s):
        print("No")
        break

Solution (Python):
s = input()
t = input()
if t in s*2:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
t = input()

flag = False

for i in range(len(t)):
	r = t[:i]
	v = t[i:]
	if v + r == s:
		flag = True
		break

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

Solution (Python):
s=input()
t=input()
i=0
h=0
while i<=len(s):
    if (s[i+1:]+s[0:i+1]==t):
        h=1
        break
    i+=1
if h:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
T = input()
ans = "No"
for i in range(len(S)):
    if T == S[i:] + S[:i]:
        ans = "Yes"
        break
print(ans)

Solution (Python):
c = raw_input().split()
d =raw_input().split()
 
 
a = list(c[0])
b = list(d[0])
 
 
size= len(a)
bsize = len(b)
 
numsum = 0
numsummax =0
 
for i in range(size): 
    numsum = 0
    for j in range(size): 
        
 
            
        if a[j] == b[(i+j)%size]: 
 
            numsum = numsum +1
            
        else:
            numsum = 0
            
        
    if numsummax<numsum:
            numsummax = numsum
 
if size == bsize and numsummax == size: 
    print "Yes" 
else: 
    print "No"

Solution (Python):
s = input()
t = input()

flag = False
for i in range(len(s)):
    s2 = s[i:] + s[:i]
    if s2 == t:
        flag = True
        break

if flag == True:
    print("Yes")
else:
    print("No")

Solution (Python):
a=input()
b=input()

flag=0
if a==b:
    flag=1
else:
    for i in range(len(a)):
        a=a[-1:]+a[:-1]
        if a==b:
            flag=1
            break

if flag==1:
    print('Yes')
elif flag==0:
    print('No')

Solution (Python):
S = input()
T = input()
L = len(T)

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

Solution (Python):
s = input()
t = input()
for i in range(len(s)):
    if s==t:
        print('Yes')
        exit()
    else:
        s = s[len(s)-1] + s[0:-1]
print('No')

Solution (Python):
s = input()
t = input()
if t in s+s:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
print('Yes' if input() in s+s else 'No')

Solution (Python):


import sys
import math
import itertools as it
from collections import deque

sys.setrecursionlimit(10000000)

S = raw_input()
T = raw_input()

sz = len(S)
S += S

for i in range(sz):
    if S[i : i + sz] == T:
        print "Yes"
        exit()

print "No"

Solution (Python):
s = input()
t = input()
r = "No"
for i in range(len(s)):
  if s[i:]+s[:i] == t:
    r = "Yes"
    break
print(r)

Solution (Python):
S = input() * 2
T = input()
if T in S:
  print('Yes')
else:
  print('No')

Solution (Python):
from sys import stdin
from fractions import gcd
S =[i for i in input()]
T =[i for i in input()]
ans = False
for i in S:
    if S == T :
        ans = True
        break
    S.append(S.pop(0))
if ans :
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
T = input()

if T in S * 2:
    print("Yes")
else:
    print("No")

Solution (Python):
s,t=list(input()),list(input())
n,ans=len(s),False
for i in range(n):
	flag=True
	for j in range(n):
		if s[j]!=t[(i+j)%n]:
			flag=False
			break
	if flag:
		break
print("Yes"if flag else"No")

Solution (Python):
def rotate(s):
    return s[-1] + s[:-1]

if __name__ == '__main__':
    s = input()
    t = input()

    for i in range(len(s)):
        if s == t:
            print('Yes')
            exit()
        s = rotate(s)
    print('No')

Solution (Python):
T = raw_input()
Tlist = list(T)
S = raw_input()

i = 0
while i < len(Tlist):
  i = i+1
  Tword = ''
  for j in range(0,len(Tlist)):
    Tword = Tword + Tlist[j]

  if Tword == S:
    print('Yes')
    break

  last_word = Tlist[-1]
  new_List =[0 for k in range(len(Tlist))]
  for j in range(1,len(Tlist)):
    new_List[j]=Tlist[j-1]
  new_List[0]=last_word
  Tlist = new_List

if Tword != S:
  print('No')

Solution (Python):
s=input()
t=input()
for i in range(0,100):
    if s == t:
        print('Yes')
        exit()
    else:
        s=s[-1]+s
        s=s[:-1]
print('No')

Solution (Python):
S,T=input()*2,input()
print(['No','Yes'][T in S])

Solution (Python):
a = input()
b = input()
c = len(a)
a_list = list(a)
b_list = list(b)
for i in range(101):
  tmp = a_list[0]
  for j in range(c-1):
    a_list[j] = a_list[j+1]
  a_list[c-1] = tmp
  if a_list == b_list:
    print("Yes")
    exit()
print("No")

Solution (Python):
S = str(input())
T = str(input())

S = list(S)
T = list(T)

A = S
for i in range(len(S)):
    AA = list(A[len(S) - 1])
    B = A[0:len(S) - 1]
    AA.extend(B)
    A = AA
    if A == T:
        p = 1
        break
    else:
        p = 0
        
if p == 1:
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())
for _ in range(len(s) + 1):
    if s == t:
        print('Yes')
        break
    s = [s[len(s) - 1]] + s[:len(s) - 1]
else:
    print('No')

Solution (Python):
from sys import stdin                                                                                                                                                                                       
S = stdin.readline().rstrip()                                                                                                                                                                               
T = stdin.readline().rstrip()                                                                                                                                                                               
                                                                                                                                                                                                            
sl = list(S)                                                                                                                                                                                                
for x in range(len(S)):                                                                                                                                                                                     
    if S == T:                                                                                                                                                                                              
        print("Yes")                                                                                                                                                                                        
        break                                                                                                                                                                                               
    fin = sl.pop()                                                                                                                                                                                          
    sl =list(fin) + sl                                                                                                                                                                                      
    sl2 = "".join(sl)                                                                                                                                                                                       
    if sl2 == T:                                                                                                                                                                                            
        print("Yes")                                                                                                                                                                                        
        break                                                                                                                                                                                               
    if x == len(S) - 1:                                                                                                                                                                                     
        print("No")

Solution (Python):
s=list(input())
t=list(input())
flag=False
cnt=0
if sorted(s)==sorted(t):
  a=s.index(t[0])
  for i in range(len(s)):
    b=i+a
    if b>=len(s):
      b-=len(s)
    if s[b]==t[i]:
      cnt+=1

if cnt==len(s):
  flag=True
print('Yes' if flag else 'No')

Solution (Python):
input1 = raw_input().replace("\n", "")
input2 = raw_input().replace("\n", "")

if len(input1) != len(input2):
    print "No"
else:
    n_len = len(input1)

result = "No"
for i in xrange(n_len):
    input1_new = input1[i:] + input1[:i]
    if input1_new == input2:
        result = "Yes"
        break
print result

Solution (Python):
S = input()
T = input()

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

Solution (Python):
s = input()
t = input()

print("Yes" if t in [s[i:]+s[:i] for i in range(len(s))] else "No")

Solution (Python):
S = list(input())
T = list(input())

B = False

for s in S:
    if S == T:
        B = True
    else:
        p = S[0]
        del S[0]
        S.append(p)

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

Solution (Python):
def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    result = NO
    for i in range(len(s1)):
        p = s1[i:] + s1[:i]
        if(p in s2):
            result = YES
    
    print(result)
        
if __name__ =='__main__':
    B()

Solution (Python):
inp = [input() for _ in range(2)]
s = inp[0]
t = inp[1]
 
s = list(s)
t = list(t)

for i in t:
    t.append(t[0])
    t.pop(0)
    if s == t:
        print("Yes")
        break
if s != t:
    print("No")

Solution (Python):
s = input().strip()
t = input().strip()

is_success = False
temp_s = s
for _ in range(len(s)):
    temp_s = temp_s[1:]+temp_s[0]

    if temp_s == t:
        is_success = True

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

Solution (Python):
def spaceinput():
    return list(map(int,input().split(" ")))

def rotate(s):
    return s[-1]+s[:-1]

s=input()
s2=input()

def chk(s,s2):
    for i in range(len(s)):
        
        if s==s2:
            return True
        s2=rotate(s2)

    return False

if chk(s,s2):
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()

if any([t == s[i:]+s[:i] for i in range(len(s))]):
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()


def rotation(s):
    for x in range(len(s)):
        s = s[-1] + s[:-1]
        if s == t:
            return "Yes"
    return "No"

print(rotation(s))

Solution (Python):
S = input()
T = input()
l = len(S)
ok = 1
for i in range(l):
   T = T[l-1]+T[0:l-1]
   if S==T:
      print("Yes")
      break
   elif l-1==i:
      print("No")
      break

Solution (Python):
s = list(input())
t = list(input())

flag = False
for i in range(len(s)):
    if (s == t):
        flag = True
        break
    ls = s
    s.append(ls[0])
    s.pop(0)

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

Solution (Python):
import re
S = input()
T = input()
S2 = S * 2
if re.search(T, S2):
    print('Yes')
else:
    print('No')

Solution (Python):
a=input()
b=input()

l=len(a)

for i in range(0,l) :

    s=a[i+1:]+a[:i]+a[i]

    if s==b:
        x=1
        break
    else:
        x=0


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

Solution (Python):
import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[a-1::]+s[:a-1:]
    if s == t :
        print("Yes")
        sys.exit()

print("No")

Solution (Python):
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")

Solution (Python):
S = input()
N = input()

for i in range(len(S)):
    if S == N:
        a = 1
        break
    elif S[-i:] + S[0:len(S) - i] == N:
        a = 1
        break

    else:
        a = 0

if a == 1:
    print("Yes")

else:
    print("No")

Solution (Python):
s = list(input())
t = input()
flag = False
for i in range(len(s)):
    if "".join(s) == t:
        flag = True
        break
    else:
        flag = False
    w = s[0]
    for j in range(len(s)-1):
        s[j] = s[j+1]
    s[-1] = w
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()

tt = t + t

if tt.find(s) != -1:
    print("Yes")
else:
    print("No")

Solution (Python):

str1 = input()
str2 = input()


result = ""
str_len = len(str1)
for i in range(str_len):
    if((str1[str_len - i:] + str1[0:str_len - i]) == str2):
        result = "Yes"
        break


if(result != "Yes"):
    print("No")
else:
    print(result)

Solution (Python):
Spr = input()
T = list(input())
S = list(Spr)

change = ""
ok = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change += T[j+i]
    for k in range(i):
      change += T[k]
    if Spr == change:
      if ok == 0:
      	print("Yes")
      	ok = 1
    change = ""

if i == len(S) - 1 and ok == 0:
  print("No")

Solution (Python):
input_a = input()
input_b = input()
if input_a == input_b:
    print('Yes')
    exit()

alt_a = input_a
res = False

while True:
    alt_a = alt_a[1:] + alt_a[0]

    if alt_a == input_a:
        break

    if alt_a == input_b:
        res = True
        break

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

Solution (Python):


def main():
    s1 = input()
    s2 = input()

    _s = s2

    for i in range(len(s1)):
        if s1 == _s:
            print("Yes")
            return
        else:
            _s = rotate(_s)
    print("No")
    return

def rotate(arr):
    return arr[-1] + arr[:-1]


if __name__ == "__main__":
    main()

Solution (Python):
S = input()
T = input()

length = len(S)

a = []
for i in range(length):
    a.append(S[i])

b = []
for i in range(length):
    b.append(T[i])

c = []
temp = []
for i in range(length):
    if a == b:
        print('Yes')
        break
    else:
        temp = [a[length-1]]
        c = temp + a[0:(length-1)]
        a = c
    if i == length - 1:
        print('No')

Solution (Python):
A = raw_input()
B = raw_input()
C = B + B 
if A in C:
  print "Yes"
else:
  print "No"

Solution (Python):
import sys
s = input()
t = input()
for i in range(len(s)):
  ok = 1
  for j in range(len(s)):
    if s[(i+j)%len(s)] != t[j]:
      ok = 0
  if ok == 1:
    print("Yes")
    sys.exit()
print("No")

Solution (Python):
from collections import deque
S = input()
T = input()
q = deque(list(S))
OK = False
for i in range(len(S)):
    last = q[-1]
    q.pop()
    q.appendleft(last)
    ans = list(q)
    ans = ''.join(ans)
    
    if ans == T:
        print ("Yes")
        OK = True
        break
if OK == False:
    print ("No")

Solution (Python):
def check():
  S = input()
  T = input()

  if len(S) != len(T) or False in [ S.count(s) == T.count(s) for s in list(set(S))]:
    print("No")
    return
  i = 0
  lim = len(T)
  while i < lim:
    S = S[-1] + S[0:-1]
    if S == T:
      print("Yes")
      return
    i += 1
    
  print("No")

check()

Solution (Python):
def run(s, t):
    len_t = len(t)
    for i in range(len_t):
        t = t[-1] + t[0:(len_t-1)]
        if s == t:
            return 'Yes'
    return 'No'


def read_line():
    s = input()
    t = input()
    return (s, t)


def main():
    s, t = read_line()
    ret = run(s, t)
    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
T = input()
c = dict()
T2 = list(T)
f = False
start = 1
end = len(S) -1
for i in list(reversed(range(len(S)))):
    S = S[len(S)-1] + S[0:len(S)-1]
    if T == S:
        print("Yes")
        f = True
        break
if f == False:
    print("No")

Solution (Python):
s = input()
t = input()
s = s * 2
t = t * 2
f = 0
for i in range(0,int(len(s) / 2)):
 frag = 1
 for j in range(0,int(len(s) / 2)):
  if s[j] != t[i + j]:
   frag = 0
 if frag == 1:
  f = 1
if f == 1:
 print("Yes")
else:
 print("No")

Solution (Python):
s = input()
t = input()

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

Solution (Python):


def checkStr():
    sA = s1
    for i in range(len(s1)):
        sA = sA[len(s1) - 1:len(s1)] + sA[0:len(s1) - 1]
        if sA == s2:
            return True
    return False

s1 = input()
s2 = input()
if checkStr():
    print ("Yes")
else:
    print ("No")

Solution (Python):
S = input()
T = input()

Length = int(len(S))
counter = Length-1
Answer = 'No'
while counter >= 0:
    S = S[Length - 1] + S
    S = S[:-1]
    if S == T:
        Answer = 'Yes'
    counter -=1
print(Answer)

Solution (Python):
def main():
    s = input()
    t = input()

    if is_match_swith_rotation(s, t):
        print('Yes')
    else:
        print('No')

def is_match_swith_rotation(s, t):
    if t in s + s:
        return True
    else:
        return False

main()

Solution (Python):
a = input()
b = input()
n = len(a)
b *= 2
for i in range(0, n):
	if b[i:(i + n)] == a:
		print('Yes')
		exit(0)
print('No')

Solution (Python):
s = list(input())
a = input()

success = False
for _l in range(len(s)):
    if ''.join(s) == a:
        success = True
        break
    s.insert(0, s.pop())

print("Yes" if success else "No")

Solution (Python):

s = input()
t = input()

l = list(s)

for i in range(len(t)):
    if(''.join(l)  == t):
        print('Yes')
        exit()
    u = ''.join(l)

    l = list(u)
    l.insert(0, l.pop())
    
print("No")

Solution (Python):
import sys
S=input()
T=input()
L=len(S)
f=0
"""
if(S===T):
    print("Yes")
    f=1
    """
for i in range(len(S)):
    if(T==S[L-i::]+S[0:L-i]):
        print("Yes")
        sys.exit()
if(f==0):
    print("No")

Solution (Python):
import sys

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

for i in range(len(s)):    
    if s == t:
        break

    tmp = s.pop(len(s)-1)
    s.insert(0, tmp)

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

Solution (Python):
S = input().lower()
T = input().lower()
for i in range(len(S)):
  S = S[len(S)-1:len(S)] + S[0:len(S)-1]
  if S == T:
    break
if S == T:
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
T = input()

ans = 'No'
for i in range(len(S)):
	T = T[len(T)-1:len(T)] + T[0:len(T)-1]

	if S == T:
		ans = 'Yes'
		break

print(ans)

Solution (Python):
s = list(input())
t = list(input())
counter = 0
hey = ""
while len(s) > counter:
    if s == t:
        hey = "yes"
        break
    else:
        hey = s[len(s)-1]
        s.pop(len(s)-1)
        s.insert(0,hey)
    counter += 1
if hey == "yes":
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()
flag = False
for i in range(len(s)):
	if s == t:
		flag = True
		break
	s = s[len(s)-1:] + s[:-1]


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

Solution (Python):
S = tuple(input()) 
T = input()

for i in range(0, len(S)):
    word = ''
    for j in range(0, len(S)):
        index = (i + j) % len(S)
        word += S[index]
    if word == T:
        print('Yes')
        break
    elif i == j:
        print('No')
        break

Solution (Python):
S = input()

T = input()

i = 0
flag = False
while flag == False and i <= len(S):
    
    if S[0:len(S) - i] == T[0+i:len(T)]:
        if S[len(S) - i:len(S)] == T[0:i]:
            flag = True
            break

    i += 1

if flag == False:
    print("No")
else:
    print("Yes")

Solution (Python):
from collections import deque

s = input()
t = input()

s_deque = deque(s)
t_deque = deque(t)

content = "No"
for i in range(len(s)):
    s_deque.rotate(1)
    if s_deque == t_deque:
        content = "Yes"
        break

print(content)

Solution (Python):
write_1 = input()
write_2 = input()

word = write_2
lis = []

judge = 0

for n in (write_2):
    lis.append(n)


for i in range(len(write_2)):
    a = lis.pop(0)
    lis.append(a)
    if write_1 == "".join(lis):
        judge += 1

print("Yes" if judge >= 1 else "No")

Solution (Python):





S = input()
T = input()

def judge(S,T):
    length = len(S)
    if length != len(T):
        return "No"
    else:
        for i in range(0, length):
            S_rotated = S[length-i:] + S[:length-i]
            if S_rotated == T:
                return "Yes"
        return "No"
print(judge(S,T))

Solution (Python):
def solve():
	S = raw_input()
	T = raw_input()
	for i in range(len(S)):
		lot_S = S[i:len(S)] + S[0:i]
		if lot_S == T:
			return True

	return False

print "Yes" if solve() else "No"

Solution (Python):
import sys
s = input()
t = input()

n = s.count(t[0])
for i in range(n):
  i = s.rfind(t[0])
  st = s[:i], s[i:]
  s = st[1] + st[0]
  if s == t:
    print('Yes')
    sys.exit()
print('No')

Solution (Python):
import sys

S = input()
T = input()

for i in range(len(S)):
  if S == T:
    print("Yes")
    sys.exit()
  S = S[1:] + S[:1]

print("No")

Solution (Python):
S = input()
T = input()
a =len(S)-1
i = len(S)
while i >0:
    if S == T:
        print('Yes')
        exit()
    else:
        S = S[a]+S[:a]
        i-=1
print('No')

Solution (Python):
a=input()
b=input()
i=0
for _ in range(len(a)):
    a=a[-1]+a[:-1]
    if a==b:
        i=1
        break
print("Yes" if i else "No")

Solution (Python):
import numpy

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

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('Yes')
        exit()
print('No')

Solution (Python):
S = input()
T = input()
s = list(S)
t = list(T)
match = False
for rotation in range(len(s)):
    flag = 0
    for i in range(len(s)):
        if i+rotation > len(s)-1:
            count = i+rotation-len(s)
        else:
            count = i+rotation
        if s[count] == t[i]:
            pass
        else:
            flag = 1
    if flag == 0:
        match = True
if match == True:
    print("Yes")
else:
    print("No")

Solution (Python):


 
def main():
	A = input()
	A_list = list(A)
	B = input()
	B_list = list(B)
	B_com = B_list + B_list
	l1 = len(A)
	l2 = len(A * 2)

	i = 0
	num = []
	for c in B_list:
		if A_list[0] == c:
			num.append(i)
			i += 1
		else:
			i += 1

	if len(num) == 0:
		print('No')
	else:
		for j in num:
			check = 0
			for k in range(l1):
				if A_list[k] == B_com[j + k]:
					check += 0
				else:
					check += 1
			if check == 0:
				print('Yes')
				break
			else:
				check = -1
		if check == -1:
			print('No')

 
if __name__ == '__main__':
	main()

Solution (Python):
S = input()
T = input()
u = len(S)-1
k = 0

for _ in range(len(S)):
    S = S[u]+S[:u]
    if S == T:
        k = 1
        break
        
if k==0:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()
t = input()
c = list(s)
d = list(t)
for i in range(len(c)):
    c.insert(0, c[-1])
    del c[-1]
    if c == d:
        print("Yes")
        break
    if i == len(c) -1:
        print("No")

Solution (Python):
s = list(input())
t = list(input())

if s == t:
    print("Yes")
else:
    for i in range(len(t)):
        
        temp = t.pop(-1)
        t.insert(0, temp)
        if s == t:
            print("Yes")
            break
    else:
        print("No")

Solution (Python):
import sys

s = input()
t = input()


if s == t:
    print("Yes")
    sys.exit(0)

ls = list(s)
for i in range(0,len(s)):
    tmp = ls.pop(-1)
    ls.insert(0,tmp)

    sls = ''.join(ls)
    

    if t == str(sls):
        print("Yes")
        sys,exit(0)
    else:
        continue

print("No")

Solution (Python):
def rotation(string, leng):
	return string[-1] + string[0:leng - 1]

def judge(a, b, leng):
	for _ in range(leng):
		if a == b:
			return 1
		else:
			b = rotation(b, leng)
	return 0

def run():
	A = input()
	B = input()
	leng = len(A)

	if leng == len(B) and judge(A, B, leng):
		print('Yes')

	else:
		print('No')

if __name__ == '__main__':
	run()

Solution (Python):
s=input()
t=list(input())

str=list(s)
ans='No'
for i in range(len(s)):
    if str == t:
        ans='Yes'
        break
    str.insert(0,str.pop(-1))
print(ans)

Solution (Python):
s = input()
t = input()
l = len(s)
f = 0
for i in range(l):
    last = l-1
    s = s[last] + s[:last]
    if s == t:
        f = 1
        print('Yes')
        break
if f == 0:
    print('No')

Solution (Python):
s = input()
t = input()
l = len(s)
f = 0
for i in range(l):
    last = l-1
    s = s[last] + s[:last]
    if s == t:
        f = 1
        print('Yes')
        break
if f == 0:
    print('No')