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):
arr = []
S = str(input())
T = str(input())
C = ""

for i1 in range(0, len(S)):
  for i2 in range(1, len(S)):
    C=C+S[i2]
  C=C+S[0]
  arr.append(C)
  S=C
  C=""

if T in arr:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

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

    len_s = len(s)

    sl = list(s)

    for i in range(len_s):
        tmp = ''.join(sl)
        if tmp == t:
            Yes()
            exit()
        sl.append(sl[0])
        sl = sl[1:]
    No()

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


s = S()
t = S()
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()

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

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

N = len(S)
res = "No"
for i in range(N+1):
    r = S[-1] + S[:N-1]
    if r == T:
        res = "Yes"
        break
    S = r

print(res)

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

if (S+S).count(T)>=1:
    print ('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()
time = 0
if s == t:
	print("Yes")
while s != t:
	tmp = s[-1]
	s = tmp + s
	s = s[:-1]
	time += 1
	if s == t:
		print("Yes")
		break
	if time >= len(s):
		print("No")
		break

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

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

print("No")

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

	for i in range(len(s)*3):
		if s == t:
			print('Yes')
			return
		s = s[-1] + s[:-1]
	print('No')
resolve()

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

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

Solution (Python):
s=input()
L=[s]
for i in range(1,len(s)):
    k=s[-i:]+s[:-i]
    L.append(k)
print('Yes' if input() in L else 'No')

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

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

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

print("No")

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

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

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

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

Solution (Python):
S = input()
T = input()
print("Yes" if T in (S+S) else "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):
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):
s = input()
t = input()
N = len(s)

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

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

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

Solution (Python):
import os

s = list(map(str,input()))
t = list(map(str,input()))
s = s*2
n = len(t)

for i in range(n):
    flag = True
    for j in range(n):
        if s[i+j]!=t[j]:
            flag = False
            break
    if flag:
        print("Yes")
        exit()

print("No")

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


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

Solution (Python):
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    S = input()
    T = input()
    ans = False
    for i in range(len(S)):
        if T == S[i:] + S[:i]:
            ans = True
            break
    print('Yes' if ans else 'No')
if __name__ == '__main__':
    main()

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

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

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

print('No')

Solution (Python):
from collections import deque
S = deque(input())
T = deque(input())
for _ in range(len(S)):
    S.rotate()
    if S == T:
        print('Yes')
        exit()
print('No')

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

Solution (Python):
S = input()
T = input()
for i in range(len(S)):
    T_ = S[i:] + S[:i]

    if T == T_:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
import sys
S=input()
T=input()
s=[]
t=[]
for i in S:
    s.append(i)
for i in T:
    t.append(i)
count=0
for i in range(len(s)):
    s_last=s[-1]
    s.insert(0,s_last)
    del s[-1]
    
    
    for p in range(len(s)):
        if s[p]==t[p]:
            count+=1
    
    if count==len(s):
        print("Yes")
        sys.exit()
    else:
        count=0
print("No")

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

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

s = len(S)-1
S = list(S)


flag = 0
for i in range(len(S)):
    h = [S[0]]
    S.remove(S[0])
    S = S + h
    str_ = ''.join(S)
    
    if str_ == T:
        flag = 1
        break
    

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

Solution (Python):
import sys
import math
import bisect
import re

def solve(s, t):
    n = len(s)
    for i in range(n):
        if s == t:
            return True
        s = s[1:] + s[0:1]
    return False

def main():
    s = input()
    t = input()
    if solve(s, t):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

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

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

print(ans)

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

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

ans = 0

if S==T:
    print("Yes")
else:
    for i in range(len(S)):
        if S[-(i+1):]+S[:(len(S)-(i+1))]==T:
            ans += 1
    print("Yes") if ans > 0 else print("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(1000):
  s=s[-1]+s[:-1]
  if s==t:
    print("Yes")
    exit(0)
print("No")

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

    for i in range(len(S)):
        for j in range(len(S)):
            if S[(i + j) % len(S)] != T[j]:
                break
        else:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
t=input()
n=len(s)
s=list(s)
for i in range(n):
  fs=s.pop()
  s=[fs]+s
  t_str=""
  for ss in s:
    t_str+=ss
  if t_str==t:
    print("Yes")
    exit(0)
print("No")

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

Solution (Python):
S = [*input()]
T = [*input()]

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    S = input()
    T = input()

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

if __name__ == "__main__":
    resolve()

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

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

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

resolve()

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

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  


S = input()
T = input()
S = S + S
print('Yes' if S.count(T) else 'No')

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")











s = list(input())[:-1]
t = list(input())[:-1]
n = len(s)
fflag = 0
for i in range(n):
    if fflag == 1:
        break
    flag = 0
    for j in range(n):
        index = (i+j)%n
        if s[index] != t[j]:
            flag = 1
            break
    if flag == 0:
        print("Yes")
        fflag = 1
if fflag == 0:
    print("No")

Solution (Python):
s = input()
t = input()
tmp = s*2
num = len(s)
for i in range(num):
    st = tmp[i:i+num]
    if st == t:
        print('Yes')
        exit()
print('No')

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

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

print("No")

Solution (Python):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=deque(input())
t=deque(input())
for i in range(len(t)):
    s.appendleft(s[-1])
    s.pop()

    if s==t:

        print("Yes")
        exit()
print("No")

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

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

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

for i in range(len(s)):
    temp = s.pop(0)
    s += temp
    if s == t:
        print("Yes")
        exit()
else:
    print("No")

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

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

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

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

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

l=len(S)
out=["No","Yes"]
flg=0

for i in range(l):
    if T==S[l-i-1:]+S[0:l-i-1]:
        flg=1
        break

print(out[flg])

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

Solution (Python):
import math
import string
import collections
from collections import Counter


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

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

print(ans)

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 = list(input())
t = input()
ans = "No"
for i in range(len(s)):
    s.append(s.pop(0))
    if "".join(s)==t:
        ans = "Yes"
print(ans)

Solution (Python):
import sys
from collections import deque

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    s = list(input())
    t = list(input())
    que = deque(t)
    n = len(s)

    for i in range(n):
        if s == list(que):
            print("Yes")
            break
        a = que.popleft()
        que.append(a)
    else:
        print("No")


if __name__ == '__main__':
    resolve()

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

Solution (Python):
def main():
    from collections import deque
    S = deque([s for s in input()])
    T = deque([s for s in input()])
    N = len(S)
    for _ in range(N):
        if S == T:
            return print("Yes")
        S.rotate()
    print("No")


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

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

N = len(S)
for i in range(N): 
    flag = True
    for j in range(N):
        if S[(i + j) % N] == T[j]:
            continue
        flag = False
        break
    if flag:
        print ('Yes')
        exit()

print ('No')

Solution (Python):
def examA():
    S = SI()
    T = SI()
    N = len(S)
    ans = "No"
    for i in range(N):
        cur = S[i:] + S[:i]
        
        if cur==T:
            ans = "Yes"
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
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()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

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

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

if __name__ == "__main__":
  resolve()

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

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

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

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):

"""
Created on Wed May 13 16:40:33 2020

@author: shinba
"""
from collections import deque

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

for i in range(len(s)):
    s.rotate()
    if s == t:
        print("Yes")
        break
else:
    print("No")

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

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

Solution (Python):
s = [a for a in input()]
t = [b for b in input()]
ans = 'No'
for i in range(len(s)):
  s.append(s.pop(0))
  if s == t:
    ans = 'Yes'
print(ans)

Solution (Python):
s=str(input())
t=str(input())
s=list(s)+list(s)
t=list(t)
ans=0
for i in range(0,len(t)):
  count=0
  for j in range(0,len(t)):
    if s[i+j]==t[j]:
      count=count+1
  if count==len(t):
    ans=1
if ans==1:
  print("Yes")
else:
  print("No")

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

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

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

Solution (Python):
from collections import deque

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

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

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

ans = "No"

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

print(ans)

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

Solution (Python):
from collections import deque

s = input()
t = input()

t = deque(t)
for i in range(len(s)):
  if s=="".join(t):
    print("Yes")
    exit()
  t.append(t.popleft())
print("No")

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

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

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

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

l = len(S)

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

print("No")

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

S = S + S
print('Yes') if S.find(T) >= 0 else print('No')

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

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

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))

from collections import Counter
def resolve():
    S=input()
    T=input()
    temp=S
    for i in range(len(S)*3):
        temp=temp[-1]+temp[:-1]
        
        if temp==T:print("Yes");return
    print("No")
    

resolve()

Solution (Python):
s = list(input())
t = input()
flag = False
for i in range(len(s)):
    if ''.join(s)==t:
        flag = True
        break
    w = s.pop()
    a = s[::-1]
    a.append(w)
    s = a[::-1]
print('Yes' if flag else 'No')

Solution (Python):
import fileinput

s = input()
t = input()

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

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

print("No")

Solution (Python):
s = input()
t = input()
print("Yes" if (s * 2).find(t) >= 0 else "No")

Solution (Python):
s = input()
t = input()
ds = s[:]
n = len(s)
turn = 0
while turn != n:
    if s == t:
        print("Yes")
        break
    else:
        s = s[-1] + s[:n-1]
    turn += 1
else:
    print("No")

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):

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

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

Solution (Python):
import sys

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

for i in range(len(S)):
    if S == T:
        print('Yes')
        sys.exit()
    else:
        tmp = S.pop()
        S.insert(0, tmp)

print('No')

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

s = list(S)

cnt = 0
jdg = False
while cnt <= len(s):
    p = s.pop()
    s = list(p) + s
    if ''.join(s) == T:
        jdg = True
        break
    cnt += 1
print('Yes' if jdg else 'No')

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

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

match = False
for i in range(len(S)):
    if (S[i:] + S[:i]) == T:
        match = True
        print("Yes")
        break

if not match:
    print("No")

Solution (Python):
S = list(input())
T = list(input())
  
ans = 0
for i in range(len(S)+1):
  if S == T:
    ans = 1
    break
  else:
    S.append(S.pop(0))

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

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

Solution (Python):
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
    s = input()
    t = input()
    s = s*3
    if t in s:
        print("Yes")
    else:
        print("No")
    return 0

if __name__ == "__main__":
    solve()

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

flag = False

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

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

ss = s+s
l = len(t)

for i in range(l):
  if ss[i:i+l] == t:
    print('Yes')
    break
else:
  print('No')

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


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

print("No")

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

Solution (Python):
s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t[1:]+t[0:1]
  t = a
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')

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

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

n = len(s)

ans = 'No'

for a in range(0, n):
    if s == t:
        ans = 'Yes'
        break
    t = t[1:] + t[0]

print(ans)