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

Solution (Python):
s = str(input())
t = str(input())
flag = False
"""
文字列の回数文だけ回転させる処理をして比較
"""
for i in range(len(s)):
    s = s[len(s)-1] + s[:len(s)-1]
    if s == t:
        flag = True
        break
    else:
        continue

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

Solution (Python):
start = input()
goal = input()

first_idx = start.find(goal[0])
id = first_idx
new_str = []
for _ in range(len(start)):
  new_str.append(start[id])
  if id == len(start) - 1:
    id = 0
  else:
    id += 1
new_str = "".join(new_str)
result = 'Yes' if new_str == goal else 'No'
print(result)

Solution (Python):
from collections import deque
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write

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

    s = deque(S)
    for _ in range(len(S)):
        if ''.join(s) == T:
            print('Yes')
            break
        s.rotate(1)
    else:
        print('No')

main()

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S, T):

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


def main():
    S = read_str()
    T = read_str()
    print(slv(S, T))


if __name__ == '__main__':
    main()

Solution (Python):


s = input()
t = input()

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

print('No')

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

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

Solution (Python):
S = input()
T = input()
flag = False
if len(S) == 2:
    if (S[0] == T[0] and S[1] == T[1]) or (S[0] == T[1] and S[1] == T[0]):
        flag = True

for i in range(1, len(S)-1):
    if S[:i] in T and S[i:] in T:
        flag = True
        break

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

Solution (Python):


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

for s in range(len(S)):
    if str(S) == str(T):
        print("Yes")
        exit()
    tmp = S.pop(0)
    S.append(tmp)
print("No")

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

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

Solution (Python):
a = input()
b = input()
l = len(a)
flag = 0
for i in range(l):
    flag2 = 1
    for j in range(l):
        if a[(j+i)%l] != b[j]:
            flag2 = 0
    flag = flag | flag2
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import stdin
a = stdin.readline().strip()
b = stdin.readline().strip()
ans = 'No'
if a in b + b:
 ans = 'Yes'
print ans

Solution (Python):
s=input()
t=input()
counter=0
for i in range(len(s)):
  former=t[0:i]
  latter=t[i:len(s)]
  sample=latter+former
  if sample==s:
    print('Yes')
    counter+=1
    break
if counter==0:
  print('No')

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

flag = False
n = len(S)

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

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

Solution (Python):

"""
Created on Sat Jul 21 19:18:37 2018
ABC103B
@author: maezawa
"""

s = input()
t = input()

n = len(s)

ans = 'No'

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

print(ans)

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 = list(input())
T = list(input())

for j in range(len(S)):
	for i in range(len(S)):
		if S[i] != T[i]:
			coincide = False
			break
		else :
		    coincide = True
	if coincide :
		break
	T.append(T[0])
	T.pop(0)

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

Solution (Python):
s = input()
t = input()
s = list(s)
t = list(t)
num = 0
for i in range(len(s)):
    s.append(s[0])
    s.pop(0)
    if s == t:
        print('Yes')
        num += 1
        break
    else:
        pass
if num == 0:
    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):
    for i in range(len(S)):
        t = S[-i:] + S[:-i]
        
        if t == T:
            return True

    return False


if __name__ == '__main__':
    main()

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


for i in range(len(S)):
    pre = S[:i]
    lat = S[i:]

    td = lat + pre
    if td == T:
        print("Yes")
        exit()
print("No")

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

for i in range(len(S)):
  a = S.pop(0)
  S.append(a)
  if S == T:
    print("Yes")
    k = 1
    break
    
if k == 0:
  print("No")

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

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

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

def cycshift(s) :
    s0 = s[0]
    ss = s[1::]
    return(ss + s0)

p = (s==t)

for i in range(len(s)):
    s = cycshift(s)
    p = (p or s==t)

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

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s1 = S()
s2 = S()

for i in range(len(s1)):
    rot = s1[i:] + s1[:i]
    if rot == s2:
        print("Yes")
        exit()
print("No")

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

def rotate(S, i):
    return S[i:] + S[:i]

ans = any(T == rotate(S, i) for i in range(len(S)))
print('Yes' if ans else 'No')

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

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

re = 'No'
n = len(S)
for i in range(n):
    tmp = S[i:n] + S[0:i]
    if tmp == T:
        re = 'Yes'
        break
        
print(re)

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]
if(S == T):
    print("Yes")
    sys.exit()

print("No")

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

FLAG = False

for i in range(counter):
  r  = ""
  for a in s:
    r += a
  if r == t:
    FLAG = True
    break
  else:
    tmp = s[0]
    s.pop(0)
    s.append(tmp)

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

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

def match(a, b):
    for i in range(len(a)):
        if a[i:] + a[:i] == b:
            return True

    return False

if match(s, t):
    print("Yes")
else:
    print("No")

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

rotate = lambda R: R[-1]+R[:-1]

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

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

print(ans)

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

Solution (Python):
a=input()
b=input()
a=a+a+a
if b in a:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
s = input()
t = input()
n = len(s)
check = False
for i in range(n):
	temp = True
	counter = 0
	while temp and counter != n:
		if i < n:
			if s[i] != t[counter]:
				temp = False
		else:
			if s[i-n] != t[counter]:
				temp = False
		counter += 1
		i += 1
	if temp:
		check = True
		break
if check:
	print('Yes')
else:
	print('No')

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

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

Solution (Python):

S = input()
T = input()

def turn(S,T,i):
    return S[i:] + S[:i]


def isOk(S,T):
    for i in range(len(S)):
        if turn(S,T,i) == T:
            print("Yes")
            return
    print("No")

isOk(S,T)

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

T_copy = list(T + T)
l = len(S)
for i in range(l):
    sub = "".join(T_copy[i:i+l])
    if sub == S:
        print("Yes")
        exit()
print("No")

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

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

'''
same = True
for i in range(len(S)):
    for j in range(len(S)):
        second = i + j
        if second >= len(S):
            second = second - len(S)
            if S[j] != S[second]:
                same = False
        else:
            if S[j] != S[second]:
                same = False

print(same)
'''
same = False
for i in range(len(S)):
    second = ""
    for j in range(len(T)):
        value = i + j
        if value >= len(T):
            value -= len(T)
            second += T[value]
        else:
            second += T[value]
    if S == second:
        same = True
        break

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

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

def shi(array):
    out = array[-1]+array[:-1]   
    return out


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

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

Solution (Python):
def main(string1, string2):
	
	answer = "No"
	
	for i in range(len(string1)):
		
		newstring = string2[i:] + string2[:i]
		
		if string1 == newstring:
			
			answer = "Yes"
	
	return answer
	
	
string1 = input()
string2 = input()

print(main(string1, string2))

Solution (Python):
s=list(input())
t=list(input())
n=len(s)
a=0
for i in range(n):
    k=s[0]
    del s[0]
    s.append(k)
    if s==t:
        a+=1
        print("Yes")
        break
if a==0:
    print("No")

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

Solution (Python):
def rot(s):
    tmp = s[0]
    s = s[1:]
    s += tmp

    return s


s1 = input()
s2 = input()

for i in range(len(s1)):
    if s1 == s2:
        print("Yes")
        exit(0)

    s2 = rot(s2)

print('No')

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

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

condition=0
x=len(S)

for i in range(x):
    if S[i:]+S[:i]==T:
        condition=1
        break

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

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

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

Solution (Python):


S=input()
T=input()
le=len(S)
s=[]
t=[]
sr=[]
for i in range(le):
  s.append(S[i])
  t.append(T[i])
  sr.append(S[i])

def rotate():
  for j in range(le):

    for i in range(le):
      sr[i]=s[(i+j)%le]
    if sr==t :
      return("Yes")
  return("No")

print(rotate())

Solution (Python):
S = input()
T = input()
for i in range(len(S)):
    if T == S[i:]+S[:i]:
        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")
        quit()
    else:
        pass
print("No")

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

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

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

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

flag = False

for i in range(len(s1)):
    next_word =s1[i:] + s1[:i]

    if s2 == next_word:
        flag = True


if flag:
    print("Yes")
else:
    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")
        break

else:
    print("No")

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

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

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

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

Solution (Python):


s = input()
t = input()
temp = list(s)
flag = 0
for i in range(len(s)):
    
    test = temp.pop()
    temp.insert(0,test)
    test = "".join(temp)
    
    if test == t:
        print("Yes")
        flag = 1
        break
if not flag:
    print("No")

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

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

    temp = s[:]

    if (len(s) != len(t)):
        print('No')
        return

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

    print('No')


if __name__ == '__main__':
    main()

Solution (Python):
a=input()
b=input()
f=False
for i in range(len(a)):
    a=a[-1]+a[:-1]
    if a==b:
        f=True
        break
if f:
    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]
        if S == T:
            print("Yes")
            break
else:
    print("No")

Solution (Python):
string1 = input()
string2 = input()

flag = False
for _ in range(len(string1)):
    if string1 == string2:
        flag = True
        break
    string1 = string1[-1] + string1[:-1]
    
if flag == True:
    print('Yes')
else:
    print('No')

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

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

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

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

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

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

ans = 'No'
if s == t:
    ans = 'Yes'

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

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

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

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

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

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

Solution (Python):
import sys

s=input()
t=input()

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

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

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

print(answer)

Solution (Python):
from sys import stdin


def main():
    S = stdin.readline().rstrip()
    T = stdin.readline().rstrip()
    for _ in range(len(T)):
        T = T[-1] + T[:-1]
        if S == T:
            print('Yes')
            break
    else:
        print('No')


if __name__ == '__main__':
    main()

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

aa = len(a)
bb = len(b)
c = 0

def co(pp,qq,p):
	for i in range(p):
		if pp[i] != qq[i]:
			return 0
	return 1 

if aa != bb:
	print("No")

else:
	for i in range(aa):
		k = a[-1]
		a = a[:aa-1]
		a.insert(0,k)
		if c == 0:
			c = co(a,b,aa)


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

Solution (Python):
import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

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

if __name__ == '__main__':
    main()

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

Solution (Python):

a=input()
b=input()
dumy=""
count=True
for i in range(len(a)):
  if(a==b):
    print("Yes")
    count=False
    break
  a=list(a)
  dumy=a.pop()
  a="".join(a)
  a=dumy+a
if(count==True):
  print("No")

Solution (Python):
a = list(input())
b = list(input())
i = 0
while True:
    c = b[-1]
    b = b[:-1]
    b = [c] + b
    if a == b:
        yesno = 'Yes'
        break
    i += 1
    if i > len(a)+1:
        yesno = 'No'
        break

print(yesno)

Solution (Python):
string_a = input()
string_b = input()
isCorrespond = False
for n in range(len(string_b)):
    tmp = string_a[0]
    string_a = string_a[1:].strip() + tmp
    if(string_a == string_b):
        isCorrespond = True
        break

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

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

l=len(S)

for i in range(l):
	if S[i:]+S[:i]==T:
		print "Yes"
		quit()
else:
	print "No"

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

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

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

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

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

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

Solution (Python):


s = input()
t = input()

ans = 'No'
if s == t: ans = 'Yes'

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

print(ans)

Solution (Python):


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

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

    
if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
S = list(input())
T = list(input())
key = T[0]
flag = False
k = 0

for i in range(len(S)):
	if S[i] == key:
		k = i
		flag = True
		break

if not flag:
	print("No")
	exit()

for i in range(len(S)):
	if not T[i] == S[(k + i) % len(S)]:
		flag = False
		break

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

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

Solution (Python):
str_s = input()
str_t = input()

for i in str_s:
    str_s = str_s[-1] + str_s[0:-1]
    if str_s == str_t:
        print("Yes")
        exit(0)
print("No")

Solution (Python):


s = input()
t = input()

string = s
res = False
for i in range(len(s)):
    x = i * -1
    string =  s[x:] + s[:x]
    if string == t:
        res = True
        break

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

Solution (Python):

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

    def rot(s, n):
        return s[n:] + s[:n]

    for i in range(0, len(s)):
        v = rot(s, i)
        if v == t:
            print('Yes')
            return

    print('No')
            
if __name__ == '__main__':
    main()

Solution (Python):
a=list(input())
b=list(input())
for i in range(len(b)):
    if a==b:
        break
    else:
        tmp=a[0]
        del a[0]
        a.append(tmp)
    
if a==b:
    print("Yes")
else:
    print("No")

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

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

slen = len(S)

for i in range(len(T)):
    if S == T:
        print('Yes')
        exit()
    else:
        slen = len(S)
        S.insert(0,S[len(S)-1])
        S.pop(len(S)-1)
print('No')

Solution (Python):
S = input()
T = input()
flag = False
tmp_S = S

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

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

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

l = len(S)
j = 0

for i in range(l):
    s_ = S[i:] + S[:i]
    if T == s_:
        j = 1
        break

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

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

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

Solution (Python):
def rotate(st):
    x = st[-1]
    return x + st[:-1]

S = input()
T = input()

flag = False

for i in range(len(S)):
    if S == T:
        flag = True
        break
    S = rotate(S)

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

Solution (Python):
import sys

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

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

Solution (Python):
def check(s,t):
	for i in range(0,len(s)):
		tmp = s[len(s)-i::] + s[0:len(s)-i]
		if tmp == t:
			return "Yes"
	return "No"

if __name__ == '__main__':
	s, t = input(), input()
	print(check(s,t))

Solution (Python):



def string_rotate(string):
    return_string = string[:]
    return return_string[-1:] + return_string[:-1]


if __name__ == '__main__':
    S = input()
    T = input()

    if S == T:
        print('Yes')
    else:
        S_copy = S[:]
        S_copy = string_rotate(S_copy)

        for i in S:
            if S_copy == T:
                print('Yes')
                break
            S_copy = string_rotate(S_copy)
        else:
            print('No')

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

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

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

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

ff = False
for i in range(len(s)):
    f = True
    for j in range(len(s)):
        if s[j] != t[i+j]:
            f = False
            break
    if not f:
        continue
    print('Yes')
    ff = True
    break
if not ff:
    print('No')

Solution (Python):
import sys

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

for i in range(len(S)):
    temp = S.pop(-1)
    S.insert(0, temp)

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

print("No")

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

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

print("No")

Solution (Python):

S = input()
T = input()

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

Solution (Python):
S = input()
T = input()
s = []
t = []
for i in range(len(S)):
    s.append(S[i])
    t.append(T[i])

key2 = 0

for i in range(len(S)):
    if t[0] == s[i]:
        key = i
        s_key = s[i::] + s[0:i]
        for j in range(len(S)):
            if s_key == t:
                key2 = 1
                break

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

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

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

if ans == "":
  ans = "No"

print(ans)

Solution (Python):


S = input()
T = input()

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

ans = "No"

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

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

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

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

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

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

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

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

print('No')

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

length = len(S)
flg = True
for i in range(length):
	if T == S[i:] + S[:i]:
		print('Yes')
		flg = False
		break
if flg:
	print('No')

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


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

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

Solution (Python):
s = input()
t = input()
n = len(s)
ans = 'No'
for i in range(n):
    a = ''
    for k in range(n):
        l = k + i
        if l >= n: l = l - n
        a += s[l]
    if a == t:
        ans = 'Yes'
        break

print(ans)

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

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

Solution (Python):
s =input()
t = input()
s = s*2
try:
    s.index(t)
    print('Yes')
except:
    print('No')

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

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

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

Solution (Python):
s = list(input())
t = list(input())
flag = 0
for i in range(len(s)):
    if s == t:
        print("Yes")
        flag = 1
        break
    a = s.pop(0)
    s.append(a)
if flag == 0:
    print("No")

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

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

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

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

    print('No')

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

flg_possible = False 

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

Solution (Python):
from numpy import *
from scipy import *
from sys import *
from collections import *

s = input()
t = input()

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

print("No")

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

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

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

if __name__ == "__main__":
    print(main())

Solution (Python):

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

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