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):
import sys

s, t = sys.stdin.read().split()
s *= 2

def main():
    n = len(t)
    for i in range(n):
        if s[i:i+n] == t:
            return 'Yes'
    return 'No'
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
s=input()
t=input()
x=s+s
if x.count(t)!=0:
    print('Yes')
else:
    print('No')

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

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

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

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

print(match)

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

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

else:
    for i in range(len(s)-1):
        lst =[]
        lst.append(s[i+1:])
        lst.append(s[:i+1])

        if ''.join(lst)==t:
            print('Yes')
            break

    else:
        print('No')

Solution (Python):
old_str = input()
compare_str = input()

old_str = [e for e in old_str]
flag = False
for i in range(len(old_str)):
    old_str.append(old_str.pop(0))
    if ''.join(old_str) == compare_str:
        flag = True
        break
if flag:
    print("Yes")
else:
    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[len(S)-1]+S[0:len(S)-1]


print("No")

Solution (Python):
from collections import deque

S = list(input())
T = list(input())
T_deque = deque(T)

S_deque = deque(S)
flag = 0
for i in range(len(S)):
    
    if S_deque == T_deque:
        flag = 1
        break
    else:
        S_deque.rotate()

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

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

for i in range(len(s)):
    h = s.pop()
    s = list(h) + s
    if s == t:
        ans = "Yes"
        break
else:
    ans = "No"

print(ans)

Solution (Python):
s = list(input())
t = list(input())
flag = 0
for i in range(102):
    if s == t:
        flag = 1
        break
    p = s.pop(-1)
    s.insert(0,p)

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

Solution (Python):
S=input()
T=input()
s=[]
t=[]
for i in range(len(S)):
    s.append(S[i])
for i in range(len(T)):
    t.append(T[i])
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):
import sys
input = sys.stdin.readline
S = list(input().rstrip())
T = list(input().rstrip())
N = len(S)
for i in range(N):
    S = list(S[-1]) + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")

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

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


def rotate(S):
        tmp = S[-1]
        S = S[:-1]
        S = tmp + S
        return S

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

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

ans = 'No'
for _ in range(len(S)):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[:-1]

print(ans)

Solution (Python):


s = input()
t = input()

S = list(s)

isPossible = False
for i in range(len(S)):
    temp = s[i:] + s[:i]
    if temp == t:
        isPossible = True

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

Solution (Python):
S = list(input())
T = list(input())
n = len(S)
ans = 'No'
if len(S) == len(T):
    for i in range(n):
        if S == T:
            ans = 'Yes'
        else:
            tmp = T[0]
            T.remove(tmp)
            T.append(tmp)
            
print(ans)

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

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

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

print(ans)

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

for i in range(len(S)):
  if S == T[i:]+T[:i]:
    j = 1
    break
  else:
    j = 0

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

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

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

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

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

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

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

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

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

Solution (Python):
print('Yes' if (input() * 2).find(input()) != -1 else 'No')

Solution (Python):
print('Yes' if (input() * 2).find(input()) != -1 else 'No')

Solution (Python):
if (input() * 2).find(input()) != -1:
 print('Yes')
else:
 print('No')

Solution (Python):
s = input();
t = input();
if str(s*2).count(t):
  print("Yes")
else:
  print("No")

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

if S.find(input()) != -1:
 print('Yes')
else:
 print('No')

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

S += S

A = S.find(T)

if A != -1:
 print('Yes')
else:
 print('No')

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

Solution (Python):

import sys
import itertools
import math


S=input()
T=input()
S_list=list(S)
T_list=list(T)

for i in range(len(T)):
  T_list.append(T_list[i])








i=0
ID_list=[]
ID_sublist=[]
pixel_list=[]
H_dummy=0
W_dummy=0
C_dummy=0












i=0
j=0








for i in range(len(T)):
    
    for j in range(len(T)):
     if S_list[j]!=T_list[i+j]:
         break
     elif j==len(S)-1 :
         print("Yes")
         sys.exit()
print("No")

Solution (Python):
def rotate(string):
    return string[1:] + string[0]


S = input()
T = input()

s = S
for _ in range(len(S)):
    s = rotate(s)
    if s == T:
        print("Yes")
        break
else:
    print("No")

Solution (Python):
S=input()
T=input()
n=len(S)
S=S+S
if sum([1 if S[i:i+n]==T else 0 for i in range(n)])>0:
  print('Yes')
else:
  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=list(input())
t=list(input())
for i in range(len(s)+1):
  if s == t:
    print("Yes")
    break
  else:
    k = s[0]
    for i in range(len(s)-1):
      s[i]=s[i+1]
    s[-1] = k
else:
  print("No")

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

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

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

S += S
if S.find(T) != -1:
    print('Yes')
else:
    print('No')

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

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


def check(s1, s2):
    return s1 == s2


def move(s, i):
    n = len(s)
    temp = ""
    for j in range(n):
        temp += s[(j+i) % n]

    return temp


N = len(str1)

for i in range(N):
    temp = move(str1, i)
    if check(temp, str2):
        print("Yes")
        break
    if i == (N-1):
        print("No")

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

ss = s+s
num = len(s)
for i in range(len(s)):
    
    if ss[i:i+num] == a:
        print("Yes")
        exit()
print("No")

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

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

if __name__ == "__main__":
  main()

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

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

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

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

print('No')

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

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

ans = 'No'

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

print(ans)

Solution (Python):
import copy
import sys

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

A = copy.deepcopy(S)
B = A.pop()
A.insert(0, B)

b = False

if S == T:
    print('Yes')
    b = True
    
while A != S:
    if A == T:
        print('Yes')
        b = True
    B = A.pop()
    A.insert(0, B)

if not b:
    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):
def solve():
    S = input()
    T = input()
    N = len(S)
    ret = False
    for i in range(N):
        if T == S[i:]+S[:i]:
            ret = True
            break
            
    print('Yes' if ret else 'No')
    
solve()

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

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

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

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

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

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

print("No")

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

Solution (Python):
import sys
S = input()
T = input()
n = len(S)

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

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



def create_new_T(_old_T):
  _newT = []
  for i in range(0, len(_old_T)):
    if i == 0:
      _newT.append(T[len(T) - 1])
    else:
      _newT.append(T[i - 1])
  return _newT

count = 0

for i in range(0, len(T)):
  T = create_new_T(T)
  if T == S:
    count += 1

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

Solution (Python):
def examB():
    S = SI(); T = SI()
    ans = "No"
    for i in range(len(S)):
        flag = True
        for j in range(len(S)):
            if S[j-i]!=T[j]:
                flag = False
        if flag:
            ans = "Yes"
            break
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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

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

sl = list(s)
tl = list(t)
sl.sort()
tl.sort()

if sl != tl:
    print('No')
    quit()

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

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

Solution (Python):

import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1

s=collections.deque(input())
t=input()
for i in range(len(s)):
    s.rotate(1)
    if "".join(s)==t:
        print("Yes")
        exit()
print("No")

Solution (Python):
from collections import deque

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

ans = 'No'
for i in range(len(s)):
    s.appendleft(s.pop())
    if t == s:
        ans = 'Yes'
        break
        
print(ans)

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

if flg == 1:
    print('Yes')
else:
    print('No')

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

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

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

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

Solution (Python):
I = input()
B = 0
I_count = len(I)
G = input()
for i in range(I_count):
    if G == I:
        print("Yes")
        exit()
    B = I[-1]
    I = I[:-1]
    I = B + I
print("No")

Solution (Python):
from collections import deque

S = deque(input())
T = deque(input())

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

    else:
        tmp = S[-1]
        S.pop()
        S.appendleft(tmp)

print("No")

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

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

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

t = input()
t = list(t)

ans = 0
temp = ''

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

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

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

Solution (Python):
S=input()
T=input()
tmp_str=[]
flag=False
for i in range(len(S)-1):
    if S==T:
        flag=True
        break;
    
    tmp=list(S)
    tmp_char=tmp.pop()
    tmp.insert(0,tmp_char)
    
    S=''.join(tmp)
    if S==T:
        flag=True
        break;

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

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

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

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

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

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

Solution (Python):


import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False 

for i in range(len(S)):
    Sr=np.roll(S,i) 
    
    if (Sr==T).all(): 
        OKflag=True
        break

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

Solution (Python):
S=input()
T=input()
r='No'
for i,_ in enumerate(S):
    if S[i:]+S[:i] == T:
        r='Yes'
        break
print(r)

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str, T: str):
    if T in (S + S):
        print(YES)
    else:
        print(NO)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    solve(S, T)

if __name__ == '__main__':
    main()

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

print(ans)

Solution (Python):
A = input()
B = input()
t = False
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')

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

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

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

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

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

S = []
T = []

for i in s:
    S.append(i)
for j in t:
    T.append(j)

ans = 'No'

for n in range(len(S)):
    last = S[-1]
    del S[-1]
    S.insert(0, last)
    if S == T:
        ans = 'Yes'
        break

print(ans)

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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
T = input()

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

Solution (Python):
flag=0
s,t=(input(),input())

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

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

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

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

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

for _ in range(len(s)+1):
    s.append(s.pop(0))
    if s == t:
        print("Yes")
        sys.exit()
    
print("No")

Solution (Python):
S = list(input()*2)
T = list(input())
ans = 'No'
for i in range(len(S)//2):
    check = 1
    for j in range(len(S)//2):
        if S[i+j] != T[j]:
            check = 0
    if check == 1:
        ans = 'Yes'
        break
print(ans)

Solution (Python):
import copy

S = list(input())
T = list(input())
Stmp = copy.copy(S)

if S == T:
    print("Yes")
else:
    flg = False
    s = S.pop(-1)
    S.insert(0, s)
    if S == T:
        flg = True

    while Stmp != S:
        s = S.pop(-1)
        S.insert(0, s)
        if S == T:
            flg = True
            break

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

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

lis = S[:]
for _ in S:
  s = lis.pop(-1)
  lis.insert(0, s)
  if lis == T:
    print('Yes')
    break
else:
  print('No')

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

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

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

print('No')

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

for i 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(T)):
    T = T[1:] + T[:1]
    if S == T:
        print("Yes")
        exit()
print("No")

Solution (Python):

s, t = [input() for _ in range(2)]

is_equal = 'No'

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

print(is_equal)

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()
t = stdin.readline().rstrip()

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

print("No")

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

Solution (Python):
S = input()
T = input() * 2
for i in range(len(S)):
    for j in range(len(S)):
        s, e = [i+j, i+j+len(S)]
        if (T[s:e] == S):
            print('Yes')
            exit()
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()
leng = len(S)
ans = False

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

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

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

Solution (Python):



S = input()
T = input()


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


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

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

    print('No')


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

    main(s, t)

Solution (Python):


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

Solution (Python):
a=input()
b=input()
al=list(a)
bl=list(b)
for i in range(len(al)):
    al.append(al[0])
    al.remove(al[0])
    if al==bl:
        print("Yes")
        exit()
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):
A = list(input())
T = str(input())

check = 'No'

for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(0, A.pop(-1))

print(check)

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):
from sys import exit
S = list(input())
T = list(input())

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

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

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

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[0]
print('No')

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

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

Solution (Python):
s = input()
t = input()
tmps = s[-1] + s[:-1]
if tmps == t:
	print ("Yes")
	exit()
while tmps != s:
	tmps = tmps[-1] + tmps[:-1]
	if tmps == t:
		print ("Yes")
		exit()
print("No")

Solution (Python):




import sys














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


def main():
    s, t = sys.stdin.read().split()
    for _ in range(len(s)):
        if s == t:
            ans = 'Yes'
            break
        s = stringRotation(s)
    else:
        ans = 'No'
    
    print(ans)



if __name__ == "__main__":
    
    main()

Solution (Python):
print("YNeos"[int(input() not in input()*2)::2])

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

flg = 0

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

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

Solution (Python):

import sys

S = input()
T = input()
t = T[0]
num = len(T)
for i in range(num):
  s = S[i:] + S[:i]
  if(s == T):
    print('Yes')
    sys.exit()
print('No')

Solution (Python):
print("Yes" if (input()*2).count(input()) > 0 else "No")

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

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

main()

Solution (Python):
import sys

s = input()
t = input()

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

print("No")

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

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

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()

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

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

if S==T:
  print("Yes")
  exit()
  
for idx in range(1, len(S)):
  Sr = S[idx:] + S[:idx]
  if Sr == T:
    print("Yes")
    exit()
print("No")

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

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()
t=input()
for i in range(len(s)):
    tmp=s[i:]+s[:i]
    if tmp==t:
        print("Yes")
        quit()
print("No")

Solution (Python):
def rotate(i):
  return S[i+1:] + S[:i+1]

S = input()
T = input()

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

print("No")

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


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

print('No')

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

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

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

Solution (Python):
s = input()
t = 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):
s = list(input())
t = list(input())
ch_list = []
n = len(s)
flag = 0
ch_list = ["" for i in range(n)]
for i in range(n):
    for j in range(n):
        ch_list[(j+i)%n] = s[j]
    if ch_list == t:
        flag = 1
if flag == 1: print("Yes")
else: print("No")

Solution (Python):
s = list(input())
t = list(input()) 
for _ in range(len(s)):
  s.insert(0, s[-1])
  s.pop()
  if s==t:
    print('Yes')
    quit()
print('No')

Solution (Python):
S = input()
T = input()
T = T * 2
if T.find(S) != -1:
    print('Yes')
else:
    print('No')

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

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

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

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

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

Solution (Python):
S=list(input())
T=list(input())
def shift(l, n):
  return l[n:] + l[:n]
N=len(S)
for i in range(N):
  if shift(S,i)==T:
    print("Yes")
    break
  else:
    pass
else:
  print("No")

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

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

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



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

print("No")

Solution (Python):
if __name__ == "__main__":
    S = input()
    T = input()

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

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