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

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

for i in range(len(s1)):
    s1=list(s1)
    a = s1.pop(-1)
    s1 = ''.join(s1)
    s1 = a+s1
    
    if s1 == s2:
        print('Yes')
        exit()
print('No')

Solution (Python):

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

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


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

for i in range(len(s)):
  for j in range(len(S)-1):
    S.append(S[j])
  del S[0:len(s)-1]
  
  if ("".join(S)) == t:
    print("Yes")
    exit()
    
print("No")

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

def rotate(S) :
    P = []
    P = S[1:]
    P.append(S[0])
    return P

for i in range(len(S)) :
    S = rotate(S)
    if S == T :
        print("Yes")
        exit()

print("No")

Solution (Python):
s = list(input())
t = list(input())
p = 0
for i in range(len(s)):
    s.append(s[0])
    s.pop(0)
    if s == t:
        print('Yes')
        break
    else:
        p += 1
if p == len(s):
    print('No')

Solution (Python):
import sys

def main():
    S = list(input())
    T = list(input())
    for i in range(len(S)):
        if S[i:] + S[:i] == T:
            print("Yes")
            sys.exit()
    print("No")

if __name__ == '__main__':
    main()

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

ans = False

for _ in range(len(t)):
    if s == t:
        ans = True
        break
    else:
        tmp = t[0]
        t.remove(t[0])
        t.append(tmp)

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

Solution (Python):
s = list(input())
t = list(input())
f = False
l = len(s)
p = ["" for _ in range(l)]
if s == t: f = True
for i in range(l):
	for j in range(l):
		p[(j+i)%l] = t[j]
	if s == p: 
		f = True
if f: print("Yes")
else: print("No")

Solution (Python):


S = input().strip()
T = input().strip()

for i in reversed( range(len(S)) ):
  r_S =S[i:len(S)] + S[0:i]
  
  if r_S == T:
    print("Yes")
    break

else:
  print("No")

Solution (Python):
s, t = [input() for i in range(2)]
n = len(s)
can = False
for i in range(n):
    if s == t:
        can = True
        break
    else:
        s = s[n - 1] + s[0:n - 1]
print('Yes' if can else 'No')

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

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

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

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

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    s=STR()
    t=STR()
    flg=0
    for i in s:
        s=s[1:]+s[0]
        if s==t:
            flg=1
    if flg==1:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Solution (Python):
S=list(input())
T=list(input())
s=len(S)
def swap(X,i,j):
  x=X[i]
  X[i]=X[j]
  X[j]=x
def swaplist(S):
  for i in range(1,s):
    swap(S,s-i,s-i-1)
  return S
count=0
if S==T:
  count=count+1
else:
  for i in range(s):
    if T==swaplist(S):
      count=count+1
if count==0:
  print('No')
else:
  print('Yes')

Solution (Python):
S = input()
T = input()
s = []
t = []
for i in range(len(S)):
  s.append(S[i])
  t.append(T[i])
flag = 0
if s == t:
  print("Yes")
  flag += 1
else:
  for i in range(len(s)):
    A = s[0]
    s.remove(A)
    s.append(A)
    if s == t:
      print("Yes")
      flag += 1
      break
if flag == 0:
  print("No")

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

Solution (Python):
s=list(str(input()))
t=list(str(input()))
def swap(s):
            s_a=s[:-1]
            s_b=list(s[-1])
            s_b.extend(s_a)
            sb="".join(s_b)
            return s_b
for i in range(len(s)):
            s=swap(s)
            if s==t:
                        print('Yes')
                        exit()
print('No')

Solution (Python):
s=input()
t=input()
str_list=[s]

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

Solution (Python):
from collections import deque

S = list(input())
T = input()
S = deque(S)
St = S
i = 0
flag = False
while i < len(S):
    if "".join(St) == T:
        flag = True
        break
    else:
        lst = St.pop()
        St.appendleft(lst)

    i += 1
print("Yes") if flag else print("No")

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


for i in range(len(S)):
    s=S.pop()
    S.insert(0,s)
    if T==''.join(S):
        print('Yes')
        exit()
print('No')

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

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

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

print('No')

Solution (Python):
S=str(input())
T=str(input())
flag=0
for i in range(len(S)):
    if S!=T:
        k=str(S[-1])
        S=S[:-1]
        S=k+S
    else:
        flag=1
print('Yes' if flag==1 else 'No')

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

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

ans=False

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

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

Solution (Python):
s=input()
t=input()
print('YNeos'[s not in t+t::2])

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

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

def rotate(s):
  rotate_list = []
  for _ in range(len(s)):
    
    tmp = s[-1]
    
    tmp = tmp + s[0:-1] 
    rotate_list.append( tmp )
    s = tmp
  return rotate_list

l = rotate(S)

if T in l:
  print('Yes')
else:
  print('No')

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

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

flag = False
for i in range(len(S)):
    S.append(S[0])
    S.pop(0)

    if S == T:
        flag = True
        break

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

Solution (Python):
s = list(input())
t = list(input())
change = s[:]
for i in range(len(s)):
    for j in range(len(s)):
        if j+i >= len(s):
            change[i+j-len(s)] = s[j]
        else:
            change[j+i] = s[j]
    if t == change:
        print("Yes")
        quit()
print("No")

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):
S = list(map(str, input()))
T = list(map(str, input()))

def judge(S, T):
	for _ in range(len(S)):
		S.insert(0, S.pop(-1))
		if S == T:
			return "Yes"
	return "No"
	
print(judge(S, T))

Solution (Python):

S=input()
T=input()
flg=False
for i in range(len(S)):
    S=S[-1]+S[:-1]
    if S==T:
        flg=True
print('Yes' if flg else 'No')

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

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

Solution (Python):
S = list(input())
T = input()
match = False
for x in range(len(S)):
    rotate = S.pop()
    
    S.insert(0, rotate)
    moji = "".join(S)
    if moji == T:
        match = True

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

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

ss = s+s

f = 0
for i in range(len(s)):

    if ss[i:len(s)+i] == t:
        f = 1


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

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

ss = s+s+s

f = 0
for i in range(len(s)):

    if ss[i:len(s)+i] == t:
        f = 1


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

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

if S == T:
    print('Yes')
else:
    l = len(S)
    L = list(S)
    for i in range(l):
        a = L[0]
        del L[0]
        L.append(a)
        s = ''.join(L)
        if s == T:
            print('Yes')
            break
    else:
        print('No')

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

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

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

Solution (Python):
s=input()
t=list(input())
f=False
for x in range(len(t)):
    m=t.pop(0)
    t.append(m)
    if "".join(t)==s:f=True
if f:print("Yes")
else:print("No")

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

Solution (Python):
s = input()
t = input()
for i in range(len(s)):
    s_remain = s[:len(s)-i]
    s_tofront = s[len(s)-i:]
    if s_tofront + s_remain == t:
        print("Yes")
        quit()
print("No")

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

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

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

srot=s*2
if srot.count(t)!=0:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):




def main():
    S = input()
    T = input()
    reslut = 'No'
    for s in S:
        if S == T:
            reslut = 'Yes'
            break
        else:
            S = S[-1] + S[:-1]
    print(reslut)


if __name__ == "__main__":
    main()

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

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

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

for i in range(len(s)):
    s = [s[-1]] + s[:-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[-1] + s[:-1]

print("No")

Solution (Python):
def main():
    string = input()
    target = input()
    result = False
    for _ in range(len(target)):
        if string == target:
            result = True
            break
        string = string[-1] + string[:-1]
    if result:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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

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

fl = False
for i in range(len(S)):
    S = rotate(S)
    if S == T:
        fl = True
print('Yes') if fl else print('No')

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

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

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

A = []
for i in range(len(s1)):
    a = s1[:i]
    b = s1[i:]
    A.append(b+a)

if s2 in A:
    print("Yes")
else:
    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):
s = input()
t = input()

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

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

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

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

Solution (Python):
import sys
s = list(input())
t = list(input())
for i in range(len(s)):
    if t == s[i:] + s[:i]:
        print("Yes")
        sys.exit()
print("No")

Solution (Python):



a = list(input())
b = list(input())
for i in range(len(a)):
    a.insert(0, a.pop(-1))
    if a == b:
        print('Yes')
        break
else:
    print('No')

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


for i in range(len(a)):
    a.insert(0, a.pop(-1))
    
    if a == b:
        print('Yes')
        break
else:
    print('No')

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

flag = False
for i in range(len(S)):
    if S == T:
        flag = True
        break
    s = S.pop(-1)
    S.insert(0, s)
    
if flag:
    print('Yes')
else :
    print('No')

Solution (Python):
s = list(input())
t = list(input())
l = len(s)
cnt=0
for x in range(l):
    if s == t:
        print('Yes')
        break
    else:
        cnt+=1
        s.insert(0, s[-1])
        s=s[:len(s)-1]
if cnt == l:
    print('No')

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


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

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

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

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

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

for i in range(len(S)):
    k = []
    for j in range(len(S)):
        if j == 0:
            k.append(S[-1])
            continue
        k.append(S[j - 1])
    S = k
    if "".join(S) == T:
        print("Yes")
        exit()
print("No")

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

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

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

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

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):
s = list(input())
t = input()

prev = s
for i in range(len(s)):
    prev = list(prev[-1]) + prev[:-1]
    if ''.join(prev) == t:
        print('Yes')
        exit()

print('No')

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

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

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

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


if S in T:
    print('Yes')
else:
    print('No')

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

def rolling(word, n):
    return word[n:len(word)] + word[:n]

for i in range(length):
    if rolling(s, i) == t:
        print('Yes')
        exit()

print('No')

Solution (Python):
Ss=input()
Ts=input()
s=[_ for _ in Ss]
t=[_ for _ in Ts]
l=len(Ss)
for i in range(l):
  temp=s[l-1]
  for j in range(l-1,-1,-1):
    s[j]=s[j-1]
  else:
    s[0]=temp
  if s==t:
    res='Yes'
    break
else:
  res='No'
print(res)

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

flag = False
for i in range(len(S)):
    s = ""
    for j in range(len(S)):
        a = (i+j)%len(S)
        s = s+S[a]
    if s==T:
        flag = True
        break
if flag:
    print("Yes")
else:
    print("No")

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

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

print("No")

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

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

for i,_ in enumerate(s):
  if s[i:]+s[:i] == t:
    print('Yes')
    break
else:
  print('No')

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

flag=False

for i in range(len(s)):
    buf=s[-1]
    s.insert(0,buf)
    del s[-1]
    if "".join(s) == t:
        flag=True

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

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

flag=False

for i in range(len(s)):
    buf=s[-1]
    s.insert(0,buf)
    del s[-1]
    if "".join(s) == t:
        flag=True

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

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

Solution (Python):
S=input()
T=input()
st=S
c=""
buf=""
flag=0
for i in range(len(S)):
    buf=st[:len(st)-1]
    c=st[len(st)-1]
    st="".join((c,buf))
    if (st==T):
        flag=1
        break

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

Solution (Python):
s, t = input(), input()
 
cnt = 0
while cnt <= len(s):
    s = s[-1] + s[:-1]
    if s == t:
        print("Yes")
        exit()
    cnt+=1
print("No")

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

Solution (Python):
def solve(s, t):
    return 'Yes' if any(t == s[i:] + s[:i] for i in range(len(s))) else 'No'

_s = input()
_t = input()
print(solve(_s, _t))

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

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
t = input()
flag = 0
for i in range(len(s)):
    s = s[1:]+s[0]
    
    if t == s:
        flag = 1
print("Yes" if flag else "No")

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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
T = readline().decode('utf8').rstrip()

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

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

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

Solution (Python):
s = list(input())
t = list(input())
for i in range(len(s)):
  check = True
  for j in range(len(s)):
    if t[j] != s[(i+j)%len(s)]:
      check = False
  if check:
    print("Yes")
    exit()
      
print("No")

Solution (Python):
import sys
s=input()
t=input()
lists=list(s)
for _ in range(len(s)+1):
    s_top=lists.pop(0)
    lists.append(s_top)
    if(t==''.join(lists)):
        print("Yes")
        sys.exit()
print("No")

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

for i in range(len(s), 0, -1):
    if s == tt[i:i+len(s)]:
        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()
flag = True

for i in range(len(s)):
    s1 =  s[i:len(s)] + s[:i]
    
    if s1 == t:
        print("Yes")
        flag = False
        break

if flag:
    print('No')

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

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

print('No')

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

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

print('No')

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


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

print('No')

Solution (Python):
import sys

s = str(input())
t = str(input())


for i in range(len(s)):
    for j in s:
        if(t == s[i:]+s[:i]):
            print('Yes')
            sys.exit()

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[0: len(s) - 1]
print(ans)

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

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

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

m = ""
for i in range(len(s) + 1):

	y = s[i:] + s[:i]
	if t == y:
		print("Yes")
		exit()

print("No")

Solution (Python):
import sys

S = input()
T = input()

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

    if T == s:
        print('Yes')
        sys.exit()

print('No')

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

Solution (Python):
a,b = (list(input()) for _ in range(2))
for i in range(len(a)+1):
    if a == b:
        print("Yes")
        exit(0)
    a.insert(0,a.pop())
print("No")

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

if sorted(s) != sorted(t):
  print("No")
  exit(0)
else:
  for i in range(len(s)+1):
    if s == t:
      print("Yes")
      exit(0) 
    
    s.insert(0,s.pop())

print("No")

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

Solution (Python):


S=[i for i in input()]
T=[i for i in input()]
N=len(S)
flg=0
for i in range(N):
    if S==T:
        print('Yes')
        flg=1
        break
    else:
        S.insert(0,S[N-1])
        del S[N]
if flg==0:
    print('No')

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

Solution (Python):
S=list(input())
T=list(input())
def shift(l):
  return l[1:]+l[:1]
for i in range(len(S)):
  S=shift(S)
  if S==T:
    print("Yes")
    exit()
print("No")

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

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

rev_S = S
for s in S[::-1]:
  rev_S = s + rev_S[:-1]
  if rev_S == T:
    print("Yes")
    exit()
print("No")

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

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

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

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

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

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

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

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

Solution (Python):
s = list(input())
t = list(input())
for i in range(len(s)):
    r = s[0]
    for j in range(len(s) - 1):
        s[j] = s[j + 1]
    s[j + 1] = r
    if (''.join(s) == ''.join(t)):
        print("Yes")
        exit()
print("No")

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

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

Solution (Python):
S=input();T=input()
print("YNeos"[all(S[i:]+S[:i]!=T for i in range(len(S)))::2])

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

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

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

Solution (Python):
from collections import deque
s = deque(list(input()))
t = deque(list(input()))

for i in range(len(t)):
  if s == t:
    print("Yes")
    exit()
  hoge = s.pop()
  s.appendleft(hoge)
print("No")

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input().strip())
T = input().strip()
flag = False
for _ in range(len(S)):
    tmp = "" + S[-1]
    for i in range(len(S)-1):
        tmp += S[i]
    if tmp == T:
        flag = True
        break
    S = list(tmp)
if flag:
    print("Yes")
else:
    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):
from collections import deque
S = deque(input())
T = list(input())

for i in range(len(S)):
    S.rotate()
    if list(S) == T:
        print("Yes")
        exit()
print("No")

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

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

print(ans)

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):
import sys
s=input()
t=input()

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

Solution (Python):
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'No'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])

for i in range(L):
    if St == Tr:
        ans = 'Yes'
        break
    else:
        St.insert(0,St[L-1])
        del St[L]

print(ans)

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

tl=[]

for i in range(len(s)):
    wk = ''
    x = i
    for _ in range(len(s)):

        if x == len(s):
            x -= len(s)

        wk += t[x]
        x += 1
        
    tl.append(wk)

if s in tl:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
del S[-1]
del T[-1]
l = len(S)
ans = "No"
for i in range(l) :
    a = S[-1]
    del (S[-1])
    S.insert(0,a)
    if S == T :
        ans = "Yes"
        break
print(ans)

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()
n = len(s)
flag = 'No'
for _ in range(n):
    s = s[-1] + s[:-1]
    if s == t:
        flag = 'Yes'
        break
print(flag)

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

for i in range(len(s)):
    if (s[i:len(s)]+s[0:i])==y:
        print("Yes")
        exit()
print("No")

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

flag = False

for i in range(1, len(s)+1):
    s1 = s[:i]
    s2 = s[i:]
    if s2 + s1 == t:
        flag = True
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN




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

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

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



if __name__ == '__main__':
    main()

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

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

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



S = list(sys.stdin.buffer.readline().decode().rstrip())
T = list(sys.stdin.buffer.readline().decode().rstrip())

S = np.array(S, dtype=str)
T = np.array(T, dtype=str)


ok=False
for _ in range(len(S)):
    S = np.roll(S, 1)
    ok |= np.all(S == T)
if ok:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):

s = list(input())
t = list(input())
a = ""
status = 0

if s == t:
    print("Yes")
    status = 1
else:
    for i in range(len(s)):
        a = s.pop()
        s.insert(0,a)
        if s == t:
            print("Yes")
            status = 1
        else:
            pass

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 



S = str(input())
T = str(input())

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

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

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

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

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

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

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