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

l = len(s)

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

print("No")

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

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

Solution (Python):
S = list(input().strip())
T = list(input().strip())
f = False
for _ in range(len(T)+1):
    if S == T:
        f = True
        break
    t = T.pop(0)
    T.append(t)

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

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

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

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()
t = input()

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

Solution (Python):
S = input()
T = input()
N = len(S)
x = 0
if S == T:
    print('Yes')
    exit()
while S != T:
    if x > N:
        print('No')
        exit()
    else:
        S = S[N - 1] + S
        S = S[0:N]
        x += 1
        if S == T:
            print('Yes')
            exit()

Solution (Python):
s = input()
t = input()
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()
N = len(S)
x = 0
if S == T:
    print('Yes')
    exit()
while S != T:
    if x > N:
        print('No')
        exit()
    else:
        S = S[N - 1] + S
        S = S[0:N]
        x += 1
        if S == T:
            print('Yes')
            exit()

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

Solution (Python):
print('NYoe s'[input() in input()*2::2])

Solution (Python):
from collections import deque
s,t=deque([*input()]),deque([*input()])
for _ in range(len(s)):
  if s==t: print('Yes');break
  s.rotate(1)
else:
  print('No')

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()
T = input()

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

Solution (Python):
S=list(str(input()))
T=list(str(input()))
for i in range(len(S)):
    S.append(S[i])
j=0
while j+len(T)<=len(S):
    if S[j:j+len(T)]==T:
        print('Yes')
        exit()
    j+=1

print('No')

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

for _ in range(len(S) + 1):
    if S == T:
        print("Yes")
        exit()

    s1 = S[0]
    s2 = S[1:]
    S = s2 + s1

print("No")

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

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

s+=s

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

Solution (Python):


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


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

print("No")

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

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

    for i in range(len(S)):
        if S == T:
            print('Yes')
            return
        else:
            p = S.pop(-1)
            S.insert(0, p)
    print('No')
main()

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

s=input()
t=input()

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

res = False
for _ in range(len(s)):
    if s == t:
        res = True
        break
    s = s[1:] + s[0]
print('Yes' if res else 'No')

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


cnt = 0
while cnt < 100000:
    last = s.pop()
    s.appendleft(last)
    if s == t:
        print('Yes')
        exit()
    cnt += 1
print('No')

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

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

for i in range(len(S)+1):
  if S == T:
    print('Yes')
    exit()
  S = rot(S)
  
print('No')

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = list(input())
t = list(input())
le = len(s)
for i in range(le):
    if t == (s[le-i:]+s[:le-i]):
        print('Yes')
        exit()
print('No')

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

s = sr()
t = sr()
n = len(s)
flag = True
for i in range(n):
    flag = True
    for j in range(i,i+n):
        if s[j%n] != t[j-i]:
            flag = False
            break
    if flag:
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
import collections
s=input()
t=input()
s2=collections.deque([])
for i in s:
  s2.append(i)
for i in range(len(s)):
  if ''.join(s2)==t:
    print('Yes')
    sys.exit()
  c=s2.popleft()
  s2.append(c)
print('No')

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

print('No')

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

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

flg = False
ok = False


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

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

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

a = list(s)
b = list(t)

answer = False

for i in range(len(a)):
    if a == b:
        answer = True
        break
    else:
        c = []
        p = a[len(a)-1]
        c.append(p)
        for j in range(len(a)-1):
            c.append(a[j])
        for h in range(len(a)):
            a[h] = c[h]

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

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

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

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

s = input()
t = input()

flg = False
for i in range(len(s)):
  flg = flg or rotate(s, i) == t

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

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

Solution (Python):
S = list(input())
T = list(input())
flag = True
for _ in range(len(S)):
    last = S.pop()
    S.insert(0, last)
    if S == T:
        print('Yes')
        flag = False
        break
if flag:
    print('No')

Solution (Python):



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

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

ans = "No"

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

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

Solution (Python):





















































def calculation(lines):
    la = lines[0]
    lb = lines[1]
    flag = False
    for _ in range(len(la)):
        la = la[1:] + la[:1]
        if la == lb:
            return ['Yes']
    return ['No']



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['kyoto', 'tokyo']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['abc', 'arc']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['aaaaaaaaaaaaaaab', 'aaaaaaaaaaaaaaab']
        lines_export = ['Yes']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):

s = input()
t = input()
l = len(s)

mozi = s*2
ans = "No"

for i in range(l):
    if mozi[i:i+l] == t:
        ans = "Yes"
        break

print(ans)

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

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):
if __name__ == '__main__':
	
	s = input()
	t = input()

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

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

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

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

if t in rotates:
  print("Yes")
else :
  print("No")

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

def irekae(s):
  List = list(s)
  a = List.pop(0)
  List.append(a)
  res = ""
  for i in range(len(s)):
    res += List[i]
  return res

if S == T:
  flag = True
else:
  for i in range(len(S)):
    S = irekae(S)
    if S == T:
      flag = True
      break
if flag:
  print("Yes")
else:
  print("No")

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

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

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

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

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

rolled = S

ans = "No"

for _ in S:
    rolled = rolled[-1] + rolled[:-1]
    if rolled == T:
        ans = "Yes"
        break

print(ans)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

s, t = read().decode().rstrip().split()
ans = 'No'
for i in range(len(s)):
    s = s[-1]+s[:-1]
    if s == t:
        ans = 'Yes'
        continue
print(ans)

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

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

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

ans = False
for _ in range(len(s)):
    l = list(s)
    c = l.pop(-1)
    l.insert(0, c)
    s = ''.join(l)
    
    
    if s == t:
        ans = True
        break
    
if ans:
    print('Yes')
else:
    print('No')

Solution (Python):
def f(s,t): return t in (s + s)
print 'Yes' if f(raw_input(),raw_input()) else 'No'

Solution (Python):
s,t = open(0).read().split()

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

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

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

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

Solution (Python):
S = input()
T = input()
pos = False
i = -1
while True:
    try:
        i = T.index(S[0], i+1)
        if T[i:] + T[:i] == S:
            print("Yes")
            break
    except:
        print("No")
        break

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

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

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

print(count)

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

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


if __name__ == "__main__":
    solve()

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

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

Solution (Python):
import numpy as np 
s=input()
t=input()
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 _ in range(len(S)):
    S_lst = list(S)
    tmp = S[0]
    for i in range(len(S) - 1):
        S_lst[i] = S_lst[i+1]
    S_lst[-1] = tmp
    S = ''.join(S_lst)
    
    if S == T:
        print("Yes")
        exit()
else:
    print("No")

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

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


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

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

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

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

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

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

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

S = s * 2
if t in S:
    print('Yes')
else:
    print('No')

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

n = 0
m = len(s)
while n != m:
  if s == t:
    print("Yes")
    exit()
  s = s[-1]+s[:m-1]
  n += 1
print("No")

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

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

for i in range(len(S)):
    flg = True
    for j in range(i, len(S)):
        if S[j] != T[j - i]:
            flg = False
            break
    if not flg:
        continue
    for j in range(i):
        if S[j] != T[j + len(S) - i]:
            flg = False
            break
    if flg:
        print('Yes')
        sys.exit()
print('No')

Solution (Python):
p=input()
q=input()
q=2*q
s=len(p)
u=0
l=len(q)
for i in range(l):
    if p==q[i:s+i]:
        print("Yes")
        u=1
        break
if u==0:
    print("No")

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

T = T+T

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

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

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

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
t = S()
ans = 'No'
for _ in range(101):
    if s == t:
        ans = 'Yes'
        break
    else:
        t = t[1:] + t[0]
print(ans)

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

Solution (Python):

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

Solution (Python):
import sys
input = sys.stdin.readline
 
S = input().rstrip('\n')
T = input().rstrip('\n')

result = 'No'

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

      
print(result)

Solution (Python):









import sys
input = sys.stdin.readline

S = list(input().rstrip('\n'))
T = list(input().rstrip('\n'))

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

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

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

print(ans)

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

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = s()
b = s()

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

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

sys.exit() if not (S.islower() or T.islower()) else ''
sys.exit() if not (2 <= len(S) <= 100) else ''

array_S = list(S)
array_T = list(T)

for I in range(len(array_S)):
    array_S.insert(0,array_S.pop(-1))
    if array_S == array_T:
        print('Yes')
        sys.exit()
print('No')

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

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

print('No')

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

L = len(S)

ok = False

for i in range(L):
    if T == S[i:L] + S[0:i]:
        ok = True

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

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

s_len = len(s)

is_yes = False

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

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

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

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

N=len(S)
F=False
for _ in range(N):
    S=S[-1]+S[:-1]
    F|=(S==T)

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

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

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

t = list(input())

f = 0

for i in range(len(s)):
    s.append(s[0])
    del s[0]
    if s == t:
        f = 1
        
if f == 1:
    print("Yes")
else:
    print("No")

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

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

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

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

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

else:
    print("No")

Solution (Python):


S = input()
T = input()

cnt = 0
while cnt < len(S):
    S = S[-1] + S[:-1]
    cnt += 1
    if S == T:
        print('Yes')
        exit()


print('No')

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

Solution (Python):
from collections import deque
import sys

deque_s = deque(list(input()))
deque_t = deque(list(input()))

for _i in range(len(deque_s)):
    deque_s.rotate()
    if deque_s == deque_t:
        print('Yes')
        sys.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)):
    if s == t:
        ans = "Yes"
        break
    t.rotate()

print(ans)

Solution (Python):
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

ans = ans(s,t)

print(ans)

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

Solution (Python):
S = input()
T = input()
a = "No"

for n in range(len(S)):
  if S[n:]+S[:n]==T:
    a = "Yes"

print(a)

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

Solution (Python):

from collections import deque

S = deque(str(input()))
T = deque(str(input()))
N = len(S)
ans = 'No'

for _ in range(N):
    S.append(S.popleft())
    if S == T:
        ans = 'Yes'

print(ans)

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

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

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

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

Solution (Python):
import sys

s = input()
t = input()

for i in range(len(s)):
    f = 1
    for j in range(len(s)):
        if s[j] != t[j-i]:
            f = 0
    if f == 1:
        print('Yes')
        sys.exit()

    
print('No')

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

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

Solution (Python):
def resolve():
    from collections import deque
    S = deque(input())
    T = deque(input())
    for i in range(len(S)):
        S.rotate(1)
        if list(S) == list(T):
            print("Yes")
            return
    print("No")


resolve()

Solution (Python):
def actual(s, t):
    """
    kyoto
    okyot
    tokyo
    otoky
    yotok
    kyoto
    """
    for _ in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return 'Yes'

    return 'No'

s = input()
t = input()

print(actual(s, t))

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

sd = deque(s)
n = len(s)
for i in range(n):
    if list(sd) == t:
        print('Yes')
        exit()
    sd.appendleft(sd.pop())

print('No')

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

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


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


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

print("No")

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

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

Solution (Python):
def rolling(str, n):
    return str[n:len(str)] + str[:n]


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

print("No")

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


s = s*2

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

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

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

S = input()
T = input()

for dif in range(len(S)):
    ok = True
    for i, t in zip(range(dif, dif+len(S)), T):
        ri = i%len(S)
        if S[ri] != t:
            ok = False
        if not(ok):
            break
    else:
        if ok:
            print('Yes')
            exit()
else:
    print('No')

Solution (Python):
import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    S = deque(input())
    T = deque(input())
    same = False
    for _ in range(len(S)):
        if S == T:
            same = True
            break
        c = S.popleft()
        S.append(c)
    if same: print("Yes")
    else: print("No")


if __name__ == "__main__":
    main()