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):
a = input()
b = input()
for i in range(len(a)):
    if a == b:
        print("Yes")
        exit()
    else:
        a = a[-1] + a[0:-1]
print("No")

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

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

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

if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
x = input()
ori = input()
loop = 1000
while loop != 0:
    if x == ori:
        print("Yes")
        break
    y = [y for y in x]
    if loop == 1000:
        loop = len(y)
    move = y.pop(0)
    y.append(move)
    x = "".join(y)
    loop -= 1
if loop == 0:
    print("No")

Solution (Python):


s = raw_input()
t = raw_input()

n = len(s)
for i in range(n):
    for j in range(n):
        if s[(i+j)%n] != t[j]:
            break
        elif j == n-1:
            print "Yes"
            exit()
print "No"

Solution (Python):
A = input()
B = input()
n = len(A)

if A == B:
    print("Yes")
    
else:
    for i in range(1,n):    
        C = A[-i:] + A[:n-i]
        if C == B:
            print("Yes")
            break
    else:      
        print("No")

Solution (Python):

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

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

for _ in range(len(s)):
    s.insert(0,s[-1])
    del s[-1]
    if s==t:
        print('Yes')
        exit()
print('No')

Solution (Python):
s = raw_input()
t = raw_input()
ans = 'No'
for i in range(0, len(s)):
	top = s[i:]
	bottom = s[:i]
	if t == top + bottom:
		ans = 'Yes'
		break
print ans

Solution (Python):
def solution(a, b):
    
    if (a + a[:-1]).find(b) >= 0:
        return 'Yes'
    else:
        return 'No'

def main():
    a = raw_input().strip()
    b = raw_input().strip()
    print solution(a, b)

if __name__ == '__main__':
    main()

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

S = list(s)
T = list(t)

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

Solution (Python):
import sys

s = input()
t = input()
n = len(s)
for i in range(n):
    for j in range(n):
        if s[j] == t[(i + j) % n]:
            continue
        else:
            break
    else:
        print('Yes')
        sys.exit(0)
    continue
print('No')

Solution (Python):

S, T = [input() for i in range(2)]

for i, si in enumerate(S):
    if si == T[0]:
        if S[i:] + S[:i] == T:
            print("Yes")
            break
else:
    print("No")

Solution (Python):

S = input()
T = input()
for i in range(100):
    Scheck=S[i+1:]+S[0:i+1]
    if(Scheck==T):
        print("Yes")
        exit()
print("No")

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

Solution (Python):



import sys

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

    while True:
        if count == len(s2):
            break
        if s1 == s2:
            print("Yes")
            break
        s2 = s2[-1:] + s2[0:-1]
        count = count + 1

    if count == len(s2):
        print("No")

    return 0

if __name__ == "__main__":
    sys.exit(main())

Solution (Python):

S = input()
T = input()
if(S==T):
    print("Yes")
    exit()
for i in range(100):
    Scheck=S[i+1:]+S[0:i+1]
    if(Scheck==T):
        print("Yes")
        exit()
print("No")

Solution (Python):
S = input()
T = input()
L = []
for i in S :
    S.replace(i,"")
    S = S + i
    L.append(S)
if T in S :
    print("Yes")
else :
    print("No")

Solution (Python):
S = input()
T = input()
LS = list(S)
hantei = False

for i in range(len(S)):
    temp1 = LS[0]
    LS[0] = LS[-1]
    
    for j in range(1, len(S)):
        if j % 2 != 0:
            temp2 = LS[j]
            LS[j] = temp1
            
        else:
            temp1 = LS[j]
            LS[j] = temp2
            
    LStoS = "".join(LS)
    
    if LStoS == T:
        hantei = True
        break

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

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

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

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

Solution (Python):
import sys
S = input()
T = input()
S = S + S

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

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

for _ in range(len(s)):
    if s == t:
        flag = True
        break

    s = s[-1] + s[:-1]

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

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

def revolve(letters):
    last_l=letters[-1]
    letters_1=letters[:-1]
    letters_new=last_l+letters_1
    return letters_new


count=0
word=S
while count<=len(S):
    revolve(word)
    if revolve(word)==T:
        print("Yes")
        break
    else:
        if count==len(S):
            print("No")
            break
        else:
            word=revolve(word)
            count+=1

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

Solution (Python):

S = input()
T = input()

ans = "No"

X = len(S)

for i in range(X):
    if S == T:
        ans = "Yes"
        break

    S = S[X-1] + S[0:X-1]
    
print(ans)

Solution (Python):
s=input()
t=input()
b=[0]*160
c=[0]*160
res=False
for i in range(len(s)):
    b[ord(s[i])]+=1
    c[ord(t[i])]+=1
for i in range(160):
    if b[i]!=c[i]:
        res=True
if res:
    print("No")
else:   
    l=len(s)
    n=l
    while n>0:
        s=s[l-1]+s[:l-1]
        if s==t:
            res=False
            print("Yes")
            break
        else:
            res=True
        n-=1
    if res:
        print("No")

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    t = S()
    l = len(s)
    for i in range(l):
        if s == t[i:] + t[:i]:
            return 'Yes'
    return 'No'


print(main())

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

for i in range(len(S)):
    if T == S[i:] + S[:i]:
        print('Yes')
        break
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()
ans = False
for i in range(len(S)):
    T = T[len(S)-1]+T[0:len(S)-1]
    if T == S:
        ans = True
        break
if ans:
    print("Yes")
else:
    print("No")

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

ans = 'No'
for i in range(len(S)):
    if S[i:] == T[0:(len(S) - i)] and S[0:i] == T[len(S)-i:]:
        ans = 'Yes'
        break

print(ans)

Solution (Python):
S = list(input())
T = list(input())
T.extend(T[:-1])
for i in range(len(S)):
  if T[i:i + len(S)] == S:
    print("Yes")
    exit()
print("No")

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

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

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

def roll(_str):
  return _str[-1] + _str[:-1]

s_alt = s
for _ in range(len(s)):
  if t == s:
    print('Yes')
    quit()
  s = roll(s)
print('No')

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

def f(S, T):
  for i in range(len(S)):
    if S[i:] + S[:i] == T:
      return 'Yes'
  return 'No'

print(f(S,T))

Solution (Python):
s=input()
t=input()
length=len(s)
flag=0

for i in range(length):
    j=i
    for k in range(length):
        if s[j%length]!=t[k]:
            break
        if k==length-1:
            flag=1
        j+=1
            
if flag==1:
    print("Yes")
elif flag==0:
    print("No")

Solution (Python):
str=list(input())
str2=list(input())
if(str2==str):
    print("Yes")
    exit()
for i in range(len(str)):
    var=str[-1]
    del str[-1]
    str.insert(0,var)
    if(str==str2):
        print("Yes")
        flag=True
        exit()
print("No")

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

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

Solution (Python):
def equals(s, t):
    for i in range(len(s)):
        rotated = s[-i:] + s[0:-i]
        if rotated == t:
            return True
    return False


if __name__ == '__main__':
    s = input()
    t = input()
    print('Yes') if equals(s, t) else print('No')

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

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

def hantei(S, T):
    for i in range(len(T)):
        if S == T:
            print("Yes")
            break
        l = list(S)
        l.append(l[0])
        del l[0]
        S = ''.join(l)
        if i == len(T)-1:
            print("No")
            
hantei(S, T)

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

n = len(S)
e = 0
for i in range(n):
    R = S[i:n] + S[0:i]
    if T == R:
        print("Yes")
        e = 1
        break

if e == 0:
    print("No")

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

if len(S) != len(T):
  print("No")
  exit()

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

print("No")

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

print("No")

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

b = False

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

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

Solution (Python):
S = list(input())
T = list(input())
x = len(S)
a = 0

while S != T:
    S.append(S.pop(0))
    a += 1
    if x == a:
        print("No")
        exit()

print("Yes")

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

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

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

alls = []
for sl in range(len(s)):
  alls.append(s[sl:] + s[:sl])

if t in alls:
  print('Yes')
else:
  print('No')

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

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

print("No")

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

Solution (Python):
import sys

l1 = sys.stdin.readline()
A = list(l1.strip())
l2 = sys.stdin.readline()
B = list(l2.strip())

flag = False

for i in range(0, len(A)):
  C = B[i:] + B[:i]
  
  if A == C:
    flag = True
    break
  

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

Solution (Python):
S = input()
T = input()
S_l = len(S)
while S_l != 0:
    if S == T:
        print("Yes")
        break
    S = S[-1]+S[0:-1]
    S_l -= 1
if S_l == 0:
    print("No")

Solution (Python):


def checkStr(S, T):
    for i in range(len(T)):
        if S == (T[i:] + T[:i]):
            return "Yes"
    return "No"

if __name__ == "__main__":
    S = input()
    T = input()
    print(checkStr(S, T))

Solution (Python):


def checkStr(S, T):
    for i in range(len(T)):
        if S == (T[i:] + T[:i]):
            return "Yes"
    return "No"

if __name__ == "__main__":
    S = input()
    T = input()
    print(checkStr(S, T))

Solution (Python):
import sys 
import math




S = input()
T = input()

flag = False

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

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

Solution (Python):
s = input()
t = input()
n = len(s)
f = [False]
i = 0
for i in range(0,n):
    if (f[0] == True):
        break
    if (s == t):
        f[0]=True
        break
    else:
        p = s[0]
        s=s.lstrip(p)
        s=s+p


if (f[0]==True):
    print("Yes")
if (f[0]==False):
    print("No")

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    S = input()
    T = input()
    for i in range(len(S) + 1):
        s = S[i:] + S[:i]
        if s == T:
            print(Yes)
            return
    print(No)


if __name__ == '__main__':
    main()

Solution (Python):
from sys import stderr
from functools import reduce
from collections import deque
from operator import add
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(repr(item))
        stderr.write(sep)
    stderr.write(end)

s = deque(input())
t = deque(input())
loop = len(s)
for i in range(loop):
    if s == t:
        print("Yes")
        break
    s.append(s.popleft())
else:
    print("No")

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

Solution (Python):
a = str(input())
b = str(input())
p=0
if len(a) != len(b):
    print("No")
else:
    for j in range(len(a)):
        s=b[:1]
        b=b+s
        b=b[1:]
        
        if a==b:
            p=1
    if p==1:
        print("Yes")
    else:
        print("No")

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

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

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

Solution (Python):
class Queue:
    def __init__(self):
        self.items = []
 
    def enqueue(self, item):
        self.items.insert(0, item)
 
    def dequeue(self):
        return self.items.pop()
 
    def size(self):
        return len(self.items)
 
    def self(self):
        return self.items
 
s = raw_input()
t = raw_input()
q = Queue()
 
j = 0
S = list(s)
L = len(s)
while j < L :
    q.enqueue(S[L - (j + 1)])
    j += 1
 
flag = False
i = 0
while i < q.size():
    x = q.dequeue()
    q.enqueue(x)
    if (list(t) == q.self()):
        flag = True
        break
    i += 1
 
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()
l = len(s)
ok = False
for i in range(l):
    if s[l-i:] + s[:l-i] == t:
        ok = True
        break
print('Yes' if ok else 'No')

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

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

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

find =False
for i in range(len(s)):
    if s == t:
        print("Yes")
        find = True
        break

    s.insert(0,s[-1])
    s.pop()
if not find:
    print("No")

Solution (Python):
S = input()
T = input()
T = T + T
index = T.find(S)
if index == -1:
	print("No")
else:
	print("Yes")

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:1]


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

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

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

if len(a)/2!=len(b):
  print("No")
else:
    for i in range(len(b)):
        if b==a[i:i+len(b)]:
            print("Yes")
            break
        if i==len(b)-1:
            print("No")

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

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

Solution (Python):


moji_S=input()
moji_T=input()

flag=0
for i in range(len(moji_S)):
	if moji_S==moji_T:
		flag =1
		break
	moji_S=moji_S[-1]+moji_S[0:-1]
if flag:
	print("Yes")
else:
	print("No")

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

Solution (Python):

str = input()
str2 = input()

str3 = str2*2

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

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

Solution (Python):


S = input()
T = input()

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

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

Solution (Python):


S = input()
T = input()

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

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

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

Solution (Python):
def main():
    word_A = input()
    word_B = input()
    for i in range(len(word_A)):
        if (word_A != word_B):
            word_A = word_A[1:] + word_A[0]
        else:
            print("Yes")
            return
    print("No")

if __name__ == "__main__":
    main()

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

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

Solution (Python):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

s=arr_data[0][0]
t=arr_data[1][0]


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

Solution (Python):
s = input()
t = input()
p = len(s)
to = False
for i in range(p):
    s = s[-1:]+s[:p-1]
    if s==t:
        to = True
        print("Yes")
        break
if to == False:
    print("No")

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

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

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

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

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

Solution (Python):
S = input()
T = input()
def charot(a):
    return a[len(a)-1]+a[:-1:]
for i in range(len(S)):
    if(charot(S) == T):
        print("Yes")
        break
    else:
        S = charot(S)
else:
    print("No")

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

Solution (Python):

import sys
if __name__ == "__main__":
    s = list(input())
    t = list(input())
    for tmp in range(0, len(t)):
        factor = []
        factor.append(s.pop())
        factor.extend(s)
        s = factor
        if ''.join(factor) ==''.join(t):
            print("Yes")
            sys.exit(0)
    else:
        print("No")

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

print("No")

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

res = False
for _ in range(len(s)):
    c = s.pop()
    s.insert(0, c)
    if t == s:
        res = True
if res:
    print('Yes')
else:
    print('No')

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

    ans = f(S, T)
    if ans:
        print("Yes")
    else:
        print("No")


def f(S, T):
    return T in (S + S)


if __name__ == '__main__':
    main()

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

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

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

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

def rotete(S, T):
    S_len = len(S)
    
    for _ in range(S_len):
        if S == T:
            return "Yes"
        S = S[S_len-1] + S[:S_len-1]
        
    return "No"

print(rotete(S, T))

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

Solution (Python):
str1 = input()
str2 = input()

if str1 == str2:
    print('Yes')

else:
    for i in range(len(str1) - 1):
    
        str1 = str1[-1] + str1[:-1]
    
        if str1 == str2:
            print('Yes')
            break
    
    if str1 != str2:
        print('No')

Solution (Python):
from collections import deque

s = deque(input())
t = deque(input())
ans = 0
for i in range(0,len(s)):
    tmp = s.pop()
    s.appendleft(tmp)
    if s == t:
        ans = 1

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

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

Solution (Python):
import sys
ip1 = input()
ip2 = input()
if(len(ip1)!=len(ip2)):
	print("No\n")
	sys.exit()
if(ip1==ip2):
	print("Yes\n")
	sys.exit()
for i in range(len(ip1)):
	for j in range(i+1,len(ip1)):
		st1 = ip1[j:len(ip1)]+ip1[0:j]
		if(st1==ip2):
			print("Yes\n")
			sys.exit()
print("No\n")
sys.exit()

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

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

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

for i in xrange(len(S)):
    if T.startswith(S[i:]) and T.endswith(S[:i]):
        print "Yes"
        break
else:
    print "No"

Solution (Python):
def main():
    flag = 0
    s = input()
    t = input()
    for _ in range(len(s)):
        t = t[len(t)-1] + t[:-1]
        if s == t:
            flag = 1
            break
    if flag:
        print("Yes")
    else:
        print("No")

main()

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

Solution (Python):
S = input()
T = input()
f=0
for i in range(len(S)):
    if S == T:
        f=1
    S = (S[-1]+S)[:-1]

if f==0:
    print('No')
else:
    print('Yes')

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

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

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

Solution (Python):
s = input()
t = input()
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)):
	if S == T:
		print('Yes')
		quit()
	tmp = S[-1]
	del S[-1]
	S.insert(0, tmp)
print('No')

Solution (Python):

a=input()
b=input()
for i in range(len(a)):
    if b==a[i:]+a[:i]:
        print('Yes')
        break
else:
    print('No')

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

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

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

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

Solution (Python):
s = input()
t = input()
ans_flag = False
for i in range(len(s)):
    if s == t:
        print("Yes")
        ans_flag = True
        break
    else:
        s = s[1:] + s[0]
if ans_flag == False:
    print("No")

Solution (Python):

s = input();
t = input();
def rotate(s):
    s = s[len(s)-1:len(s)]+s[0:len(s)-2]+s[len(s)-2:len(s)-1]
    
    return s
if len(s) == 1:
    if s==t:
        print('Yes')
    else:
        print('No')
else:
    flag = 0
    
    for i in range(len(s)):
        s = rotate(s)
        if s==t:
            print('Yes')
            flag =1
            break
    if flag ==0:
        print('No')

Solution (Python):
S,T = input(),input()
rs = ''
OK = False if S!=T else 'Yes'
for i in range(len(S)):
    S = S[-1]+S[0:-1]
    if S==T:
        OK = True
print('Yes' if OK else 'No')

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(10000)


def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))


def to_bin(x):
    return bin(x)[2:]



dp = None

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

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

        if S == T:
            print("Yes")
            sys.exit()
    
    print("No")


main()

Solution (Python):
S = input()
T = input()
if( len(S) != len(T) ):
	print("No")
	exit()
for i in range(len(S)):
	if(S == T):
		print("Yes")
		exit()
	S = S[1:]+S[0]
print("No")

Solution (Python):



def rotate(strg, n):
    return strg[n:] + strg[:n]


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

    for i in range(len(s)):
        if rotate(s, i) == t:
            print("Yes")
            return

    print("No")


if __name__ == "__main__":
    main()

Solution (Python):
s=list(input())
ss=list(input())
t=s.copy()
for i in t:
    s.pop(0)
    s.append(i)
    if s==ss:
        print("Yes")
        break
else:
    print("No")

Solution (Python):
def main():
    s = input()
    t = input()
    n = len(s)
    for i in range(n):
        ss = s[i:] + s[:i]
        if ss == t:
            print('Yes')
            return
    print('No')

main()

Solution (Python):
s = input().strip()
t = input().strip()
print ("Yes" if any(s[i:] + s[:i]  == t for i in range(len(s))) else "No")

Solution (Python):


















''' 二次元配列を一列ずつ
for i in ans:
	print(*i)
'''
''' heapq
queue = []
heapq.heapify(queue) 
heapq.heappush(queue,num) 
pop = heapq.heappop(queue) 
pop = heapq.heappushpop(queue,num) 

'''

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


S1 = input()
S2 = input()

for i in range(len(S2)):
	S2 = S2[-1] + S2[:-1]
	if S2 == S1:
		print('Yes')
		sys.exit()

print('No')

Solution (Python):
a=input()
b=input()
h=0
t=False
while h<len(a):
    if a==b:
        print("Yes")
        t=True
        break
    a=a[len(a)-1]+a[:len(a)-1]
    
    h+=1
if t==False:
    print("No")

Solution (Python):
s=input();print(["No","Yes"][input()in[s[i:]+s[:i]for i in range(len(s))]])

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

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

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

n = len(S)
def same(i, j):
    for k in range(0, n):
        if(S[(i + k)%n] != T[(j + k)%n]):
            return 0
    return 1


ans = 0
for i in range(0, n):
    ans |= same(i, 0)


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

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

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

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