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):
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j2=(j+i)%len(a)
    if a[j]!=b[j2]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

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

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

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

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

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

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

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

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

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

Solution (Python):
def judge(s, t):
    for i in range(len(s)):
        tt = s[i:] + s[:i]
        if t == tt:
            return True
    return False

S = input()
T = input()

print("Yes" if judge(S, T) else "No")

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

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

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

Solution (Python):

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

Solution (Python):
a, b = input(), input()
a *= 2
print('Yes' if b in a else '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()

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

Solution (Python):
from collections import deque
s=list(input())
s=deque(s)
t=input()
for i in range(len(s)):
  if ''.join(s)==t:
    print("Yes")
    exit()
  s.append(s.popleft())
print("No")

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

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

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

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

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

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

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

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

Solution (Python):
S = input()
T = input()
listS = list(S)
listT = list(T)
for i in S:
 
    if listS == listT:
        print("Yes")
        exit()
    else:
        hoge = listS.pop(0)
        listS.append(hoge)
print("No")

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

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

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

for i in range(len(s)):
    s.insert(0, s[-1])
    del s[-1]
    if s == t:
        print("Yes")
        break
    elif i == len(s)-1:
        print("No")

Solution (Python):
s = list(str(input()))
t = list(str(input()))
res = "No"
for i in range(len(s)) :
  s.append(s[0])
  s.pop(0)
  if(s == t) : res = "Yes"
print(res)

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=list(input())
t=list(input())
flag=False
count=0
while count!=len(s):
    a=s[-1]
    del s[-1]
    s.insert(0,a)
    if s==t:
        flag=True
        break
    count+=1
if flag:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):
s=str(input())
t=str(input())
num=len(s)
p=0
if s==t:
    print('Yes')
else:
    for i in range(1,num,1):
        a=s[-i:]
        b=s[:num-i]
        c=a+b
        if c==t:
            print('Yes')
            break
        else:
            p+=1
if p==num-1:
    print('No')

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

Solution (Python):
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=input()
t=input()
a=[]
for i in range(len(s)):
        a.append(s[i:len(s)]+s[:i])
if t in a:
        print("Yes")
else:
        print("No")

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

count = 0
while count <= len(S):
    if S == T:
        print('Yes')
        exit()

    tmp = S.pop(0)
    S.append(tmp)
    count += 1
print('No')

Solution (Python):
S=input()
T=input()
S1=list(S)
ans='No'
def f(S1,i):
    return S1[i:]+S1[:i]
for j in range(-1,len(S)-1):
    S2=''.join(f(S1,j))
    if S2==T:
        ans='Yes'
print(ans)

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

def f():
    if s==t:
        return "Yes"
    for i in range(1, len(t)):
        if (s[-i:] + s[:-i]) == t:
            return "Yes"
    return "No"

print(f())

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

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

Solution (Python):
S = list(input())
T = list(input())
new_S = S
judge = 0

if(S == T):
  print('Yes')
else:
 for i in range(len(S)):
  tmp = S.pop(-1)
  S.insert(0,tmp)
  new_S = S
  if(new_S == T):
    judge = 1
    break
 if(judge == 1):
  print('Yes')
 else:
  print('No')

Solution (Python):






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

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

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

if rotatable(S, T):
    print('Yes')
else:
    print('No')

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


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

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

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

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

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

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

Solution (Python):

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

Solution (Python):
S = input()
T = input()
if S == T:
    print('Yes')
    exit()

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

Solution (Python):
def string_rotation(S: str, T: str)->bool:
    for i in range(len(S)):
        if S[i:] + S[:i] == T:
            return True
    return False


if __name__ == "__main__":
    S = input()
    T = input()
    yes = string_rotation(S, T)
    print('Yes' if yes else 'No')

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

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

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

Solution (Python):


import sys 


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


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

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

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

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

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

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

Solution (Python):
def solve():
    S=input()
    T=input()
    l=len(S)
    for i in range(l):
        if T == S[i:] + S[:i]:
            return True
    return False

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

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

Solution (Python):
s=input()
t=input()
def C(i):
        if all(s[(i+j)%len(s)]==t[j] for j in range(len(s))):
                return True
if any(C(i) for i in range(len(s))):
    print('Yes')
else:
    print('No')

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

answer = 'No'

if S == T:
    answer = 'Yes'

for x in range(0,len(S)):
    S = S[-1] + S[0:-1]
    if S == T:
        answer = 'Yes'

print(answer)

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

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

count = 0
for i in range(len(S)):
    S.insert(0,S[-1])
    S.pop(-1)
    if S == T:
        count += 1
        break
   
if count == 1:
    print("Yes")
else:
    print("No")

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

ans = ''

if set(S)!=set(T):
    ans = 'No'

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

if not ans:
    ans = 'No'

print(ans)

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

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

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

S2 = S + S

print("Yes" if T in S2 else "No")

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

Solution (Python):
s=list(str(input()))
t=list(str(input()))
f=True
for i in range(len(s)):
    s.append(s[0])
    del s[0]
    if s==t:
        f=False
        break
    else:
        pass
print("YNeos"[f::2])

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

if S == T:
    print('Yes')
    exit()

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

print('No')

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

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

print(answer)

Solution (Python):
s=input()
t=input()
count=0
while 1:
  if s==t:
    print("Yes")
    break
  if count==len(s):
    print("No")
    break
  s=s[1:]+s[0]
  count+=1

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


ans = "No"
for i in range(len(s)):
    tmp = ''
    for j in range(len(s)):
        if i+j < len(s):
            tmp += t[i+j]
        else:
            tmp += t[i+j-len(s)]
    if tmp == s:
        ans = "Yes"

print(ans)

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

Solution (Python):
first=list(input())
second=list(input())
first_s=set(first)
second_s=set(second)
lengh_f=len(first)
lengh=len(second)
a="No"
for i in range(lengh): 
    if first_s!=second_s or lengh_f!=lengh:
        break
    tmp=tuple(second)  
    for j in range(lengh):
        if j==lengh-1:
            second[j]=tmp[0]
        else:
            second[j]=tmp[j+1]
    if first==second:
        a="Yes"
        break
print(a)

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

while i < n:
    s = s[-1] + s[:n-1]
    i += 1
    if s == t:
        print("Yes")
        exit()

print("No")

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

Solution (Python):
def rotate(S):
	S_list = list(S)
	S_last = S[-1]
	S_list.pop(-1)
	S_list.insert(0,S_last)
	return ''.join(S_list)

S = input()
check = input()
for i in range(len(S)):
	S = rotate(S)
	if S == check:
		print('Yes')
		exit()

print('No')

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

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

for i in range(len(s)):
	if t == rot(s, i):
		print('Yes')
		exit()
print('No')

Solution (Python):
import collections as cc
A = cc.deque(input())
B = cc.deque(input())
for i in range(100):
    if A == B:
        print("Yes")
        exit()
    else:
        tmp = A.pop()
        A.appendleft(tmp)
print("No")

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

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

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

Solution (Python):
def main():
    S, T = [input() for _ in range(2)]
    ans = "Yes" if S == T else "No"
    new_S = S
    for i in range(len(S)):
        new_S = new_S[-1] + new_S[:-1]
        if new_S == T:
            ans = "Yes"
            break
    print(ans)


if __name__ == "__main__":
    main()

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

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

Solution (Python):


S = input()
T = input()

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

print("No")

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

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

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  S = str(input().strip())
  T = str(input().strip())
  ans = 'No'
  for _ in range(len(S)):
    if S == T:
      ans = 'Yes'
      break
    else:
      S = S[1:] + S[0]
  print(ans)


if __name__ == '__main__':
  main()

Solution (Python):


"""
Created on Mon Feb 11 05:38:56 2019

@author: shinjisu
"""



import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


debug = True


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def prob096():  
    X = getIntList()
    K = getInt()
    dmp((X, K))
    total = sum(X) - max(X) + max(X)*2**K
    return total


def prob097():  
    X = getInt()
    dmp(X)
    if X == 1:
        return 1
    for n in range(X, 0, -1):
        dmp(n)
        for b in range(2, int(math.sqrt(X))+1):
            a = n
            exp = True
            while a > 1:
                if a % b != 0:
                    exp = False
                    break
                a //= b
            if exp:
                break
        if exp:
            break
    return n


def prob098():  
    N = getInt()
    S = input()
    dmp((N, S))
    maxChCount = 0
    for i in range(1, N):
        before = S[:i]
        after = S[i:]
        dmp((before, after))
        chCount = 0
        for j in range(26):
            ch = chr(ord('a')+j)
            if ch in before and ch in after:
                chCount += 1
        maxChCount = max(maxChCount, chCount)
    return maxChCount


def prob099():  
    a, b = getIntList()
    height = 0
    for i in range(b-a+1):
        height += i
    height -= b
    return height


def prob103():  
    S = input()
    T = input()
    for i in range(len(S)):
        S = S[1:] + S[0]
        dmp(S)
        if S == T:
            return 'Yes'
    else:
        return 'No'


def prob000():  
    return 0


debug = False  
print(prob103())

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

if S == E:
    print('Yes')
    exit()

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

print('No')

Solution (Python):
def main() -> None:
    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")


if __name__ == '__main__':
    main()

Solution (Python):
import sys
s = list(input())
t = list(input())
for _ in range(len(s)):
    if s == t:
        print('Yes')
        sys.exit(0)
    s.insert(0, s.pop())
print('No')

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

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

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

torf = False

for i in range(len(s)):
    if rolling(s, i) == t:
        torf = True
        break

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

Solution (Python):
a=input()
b=input()
alist=list(a)
blist=list(b)
ans=0
for i in range(len(alist)):
  if(alist==blist):
    ans=1
  kari3=[]
  kari3.extend(alist[-1])
  kari3.extend(alist[:len(alist)-1])
  alist=kari3
  
if(ans==0):
  print("No")
else:
  print("Yes")

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

sset = set(s)
tset = set(t)

if sset != tset:
    print('No')
    exit()









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

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

Solution (Python):
import sys

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

Solution (Python):

S = str(input())
T = str(input())
result = False

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

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

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

n = len(S)

ans = 'No'

for i in range(n):
    if ans == 'Yes':
        break
    if S[i] != T[0]:
        continue
    for j in range(n):
        k = i if i+j < n else i-n
        if S[k+j] != T[j]:
            break
        if j == n-1:
            ans = 'Yes'

print(ans)

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

flg = False

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

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

Solution (Python):
s = str(input())
t = str(input())
import sys
s_ = s
if s_ == t:
    print('Yes')
    sys.exit()

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

print('No')

Solution (Python):
s = list(input())
t = list(input())
ans = "No"
for i in range(len(s)):
    if s == t:
        ans = "Yes"
    s.append(s[0])
    del(s[0])
print(ans)

Solution (Python):
s=input()
t=input()
def turn(string):
    return string[-1]+string[0:-1]
turning=s
result=False
for i in range(len(s)):
    turning=turn(turning)
    if turning==t:
        print("Yes")
        result=True
        break

if result==False:
    print("No")

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

Solution (Python):
def word_rotation(s):
    s.insert(0,s.pop())

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

for i in range(len(S)):
    word_rotation(S)
    if S == T:
        print("Yes")
        break
else:
    print("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()

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

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

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

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

if S == T:
    print('Yes')
    exit()

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

print('No')

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

Solution (Python):
S = input()
T = input()
text = "No"
import array
for c in S:
    if S == T:
        text = "Yes"
        break
    S = S[-1] + S[:-1]
print(text)

Solution (Python):
s=list(input())
t=list(input())
ok=False
for x in range(len(s)):
    l=s[-1]
    s.pop(len(s)-1)
    s.insert(0,l)
    if s==t:
        ok=True
print("Yes"if ok else "No")

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

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

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

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

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

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

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

Solution (Python):
s = list(map(str,input()))
t = list(map(str,input()))
ans = 0
a = 0
for i in range(len(s)):
    if s == t:
        ans = 1
    S = s[0]
    s.pop(0)
    s.append(S)
if ans == 1:
    print("Yes")
else :
    print("No")

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

Solution (Python):
S=input()
T=input()
T_0_equal=[]
for i in range(len(S)):
  if(T[0]==S[i]):
    T_0_equal.append(i)

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

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

Solution (Python):

import sys



def solve(lines):
    S = lines.pop(0)
    T = lines.pop(0)
    for i in range(len(S)):
        S = S[-1] + S[:-1]
        if S == T:
            print('Yes')
            sys.exit(0)

    print('No')















lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())






s = input()                                  




t = input()
l = len(t)
a=t
for i in range(l):
    b = [a[l-1],a[:l-1]]
    a = ''.join(b)
    if a==s:
        j(1)
j(0)

Solution (Python):
S = input()
s = S * 2
ans = []
T = input()
for i in range(len(S)):
    x = s[i:i+len(S)]
    ans.append(x)
if T in ans:
    print("Yes")
else:
    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')
            exit()
    print('No')


main()

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

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


def main():
    ans = solve()
    if ans:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):


def main():
    s = input()
    t = input()
    n = len(s)
    flag = False
    for i in range(n):
        s = rot(s)
        if s == t:
            flag = True
    print("Yes" if flag else "No")

def rot(s):
    r = s[1:] + s[0]
    return r

main()

Solution (Python):
def main():
    x = input()
    y = input()

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

    if y in l:
        print("Yes")
    else:
        print("No")


def main2():
    x = input()
    y = input()
    ans = False

    s = x
    for i in range(len(x)):
        if s == y:
            ans = True
            break
        s = s[-1] + s[:-1]

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


if __name__ == '__main__':
    main2()

Solution (Python):
x = input()
y = input()

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

if y in l:
    print("Yes")
else:
    print("No")

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

answer = 'No'

if S == T:
  answer = 'Yes'

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

print(answer)

Solution (Python):
""" AtCoder """

S = input()
T = input()

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

print("No")

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

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

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

Solution (Python):
def rotate(s,time):
    return s[-time:]+s[0:-time]

s = input()
t = input()
ok = False
for i in range(len(s)):
    if rotate(s,i) == t:
        ok = True
print('Yes' if ok else 'No')

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

s=s*2

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

Solution (Python):


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

    N = len(S)
    f = False
    for i in range(N):
        if S[N - i:] + S[:N - i] == T:
            f = True
            break

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


if __name__ == '__main__':
    main()

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

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

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

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

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

print(ans)

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

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

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

Solution (Python):
s = input()
t = input()
print(["No","Yes"][t in s*2])

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

Solution (Python):
S, T = map(str, [input() for i in range(0, 2)])
print("Yes" if str(T + T).find(S) >= 0 else "No")

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

Solution (Python):
from collections import deque

S = deque(list(input().rstrip()))
T = deque(list(input().rstrip()))

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

Solution (Python):
str0 = input().strip()
str1 = input().strip()
if not len(str0) == len(str1):
  print('No')
  exit()
str0 += str0
if str1 in str0:
  print('Yes')
else:
  print('No')

Solution (Python):
def main(S, T):
    tmp = S
    for i in list(S):
        if tmp == T:
            print('Yes')
            exit()
        tmp = tmp[-1] + tmp[:-1]
    print('No')


if __name__ == '__main__':
    main(input().strip(), input().strip())

Solution (Python):
s=list(input())
t=str(input())
ans='No'
if ''.join(s)==t:
  ans='Yes'
for i in range(len(s)):
  s.append(s.pop(0))
  if ''.join(s)==t:
    ans='Yes'
print(ans)