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):
print('Yes' if input() in input()*2 else 'No')

Solution (Python):


S = input()
T = input()

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

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

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

print('No')

Solution (Python):
s,t=open(0);print(" YNeos"[t[:-1]in[s[i:-1]+s[:i]for i in range(99)]::2])

Solution (Python):
s=list(input())
t=list(input())
n=len(s)
ans="No"
for i in range(n):
    for j in range(n-1):
        ex=s[n-2-j]
        s[n-2-j]=s[n-1-j]
        s[n-1-j]=ex
    if(s==t):
        ans="Yes"
print(ans)

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

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

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

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

mod = 1000000007

"""


    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    S = sys.stdin.readline().rstrip()
    T = sys.stdin.readline().rstrip()

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

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

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

Solution (Python):
s = list(input())
t = input()
n = len(s)
f = False
for i in range(n):
    tmp = s[n-1]
    for j in range(n-1,-1,-1):
        s[j] = s[j-1]
    s[0] = tmp
    if t == "".join(s):
        print("Yes")
        f = True
        break
if not f:
    print("No")

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

Solution (Python):
def main():
    S = input()
    T = input()
    if len(S) != len(T):
        return "No"
    for i in range(len(S)):
        if S[i] == T[0] and S[i:] + S[:i] == T:
            return "Yes"
    return "No"

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

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

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

Solution (Python):
import sys
from collections import deque
import copy

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    T = inputs[1]

    string_queue = deque(S)
    T_queue = deque(T)

    for i in range(len(S)):
        if string_queue == T_queue:
            return 'Yes'
        p = string_queue.pop()
        string_queue.appendleft(p)
    return 'No'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)

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

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

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

Solution (Python):
s, t = [input() for _ in range(2)]
if t in s*2:
  print('Yes')
else:
  print('No')

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

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

print('No')

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

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

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

for i in range(n):
    p = s.pop(-1)
    s.insert(0, p)
    if s == t:
        print('Yes')
        break
    else:
        continue
else:
    print('No')

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

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

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

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

Solution (Python):



from collections import deque

S, T = input(), input()
S_q, T_q = deque(list(S)), deque(list(T))
tmp = ""

for i in range(len(S)):
    if S_q == T_q:
        print("Yes")
        exit()
    else:
        tmp = S_q.pop()
        S_q.appendleft(tmp)
else:
    print("No")

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

for i in range(len(S)):
    S_temp=S[len(S)-1]
    for j in range(len(S) - 1, 0, -1):
        S[j]=S[j-1]
    S[0]=S_temp
    if "".join(S)=="".join(T):
        print("Yes")
        exit()

print("No")

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

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

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

Solution (Python):
from collections import deque
sin = [i for i in input()]
tin = [i for i in input()]
s = deque(sin)
s_origin = deque(sin)
t = deque(tin)
s.rotate(1)
while s!=s_origin:
    if s == t or s_origin == t:
        print("Yes")
        break
    s.rotate(1)
else:
    if s_origin == t:
        print("Yes")
    else:
        print("No")

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

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

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

for _ in range(len(s)):
    if s!=t:
        t_spare=t[-1]
        t=t_spare+t[:len(t)-1]
    else:
        print("Yes")
        exit()
print("No")

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

for i in range(N):
    R = S.copy()

    for j in range(N):
        if j == N-1:
            S[0] = R[N-1]
        else:
            S[j+1] = R[j]

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

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)):
    if S==T:
        print('Yes')
        exit()
    else:
        l=[]
        l=[s for s in S]
        l.append(l.pop(0))
        S=''.join(l)
print('No')

Solution (Python):
import sys
input = sys.stdin.readline

A = list(input().strip())
B = list(input().strip())

for i in range(len(A)):
    if A[i:] + A[:i] == B:
        print("Yes")
        exit()

print("No")

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

Solution (Python):
s = input()
t = input()
x = ""
if s==t:
  print('Yes')
else:
  for i in range(len(s)):
    if i!=len(s)-1:
      if s[i]==t[0] and s[i+1]==t[1]:
        for j in range(i,len(s)):
          x += s[j]
        for k in range(i):
          x += s[k]
    elif i==len(s)-1:
      if s[i]==t[0] and s[0]==t[1]:
        for j in range(i,len(s)):
          x += s[j]
        for l in range(i):
          x += s[l]
  print('Yes' if x==t else 'No')

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


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

Solution (Python):
S = input()
T = input()
print('YNeos'[T not in (S+S)::2])

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

ss = s + s

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

Solution (Python):
S = [i for i in input()]
T = [j for j in input()] 

x = sorted(S)
y = sorted(T)
i = 0

if x == y:
  while i <= len(S):
    O = S.copy()
    S.pop()
    S.insert(0,O[-1])
    i += 1
    if S == T:
      print("Yes")
      break
  else:
    print("No")
else:
  print("No")

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

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

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

Solution (Python):
s = input()
t = input()
cnt = 0
while True:
    if cnt >= 100:
        print("No")
        exit()
    elif s == t:
        print("Yes")
        exit()
    else:
        s = s[-1] + s[:-1]
        cnt += 1

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

SS = S*2

if T in SS:
    print('Yes')
else:
    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'
    break
print(ans)

Solution (Python):
def rotate(word , n):
    return word[n:len(word)] + word[:n]

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

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

    print('No')

main()

Solution (Python):
s, t = [input() for _ in range(2)]
if s in t * 2:
  print("Yes")
else:
  print("No")

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

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

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

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


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    ans = "No"
    
    for i in range(1,len(S)+1):
        
        for j in range(len(S)):
            list_S[j] = L[-i+j]
        if list_S == list_T :
            ans = "Yes"
            break
print(ans)

Solution (Python):
import math
import copy
import sys

def rotation(s):
    rot = []
    for i in range(1, len(s)):
        rot.append(s[i])

    rot.append(s[0])

    return rot

inputa = input().split()
inputb = input().split()


























a = str(inputa[0])
inputaList = list(a)

b = str(inputb[0])
inputbList = list(b)

tmpinput = []
tmpinput = copy.deepcopy(inputaList)
tmp = []

for i in range(len(inputaList)):
    tmpinput = copy.deepcopy(rotation(tmpinput))

    flg = True
    for j in range(len(inputaList)):
        if tmpinput[j] != inputbList[j]:
            flg = False

    if flg:
        print("Yes")
        break

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

Solution (Python):
s = input()
t = input()
yes = False
for a in range(0, len(s)):
    if (s == t):
        print('Yes')
        yes = True
        break
    s = s[1:] + s[:1]
if (not yes):
    print('No')

Solution (Python):
import os, sys, re, math

lines = sys.stdin.readlines()

s = lines[0].strip()
t = lines[1].strip()

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

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

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

Solution (Python):
a = input()
b = input()
correct = False
for i in range(len(a)):
    if a[i:] + a[:i] == b:
        correct = True
print('Yes' if correct else 'No')

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

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

for i in range(len(s)):
    if rolling(s, i) == t:
        count += 1
if count == 0:
    print('No')
else:
    print('Yes')

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

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

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

for i in range(len(s)):
    s2 = s[i:] + s[:i]
    if s2 == 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):
print("Yes" if input() in input()*2 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):
import sys
S = list(input())
T = str(input())

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

print('No')

Solution (Python):
s = input()
t = input()
y = 0
def rolling(str, n):
    return str[n:len(str)] + str[:n]
for x in range(len(t)):
    if s == rolling(t, x):
        y = 1
if y == 1:
    print('Yes')
else:
    print('No')

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

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

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

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

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

flag=False
for _ in range(len(S)):
  S = list(S)
  temp = S.pop()
  S = "".join([temp]+S)
  if S==T:
    flag=True
    break
if flag:
	print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()
 
a = 'No'

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

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

S += S
flag = False

for i in range(len(S)//2):
    if S[i:i+len(S)//2] == T:
        flag = True
        break

ans = 'Yes' if flag == True else 'No'
print(ans)

Solution (Python):
S = input()
T = input()
cnt = 0
s = S + S
ans = False
if S == T:
    ans = True
else:
    for i in range(len(S)):
        if s[i]==T[0]:
            for j in range(len(T)):
                if s[i+j]==T[j]:
                    cnt +=1
            if cnt%len(T)==0:
                ans = True
            cnt = 0
if ans == True:
    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.pop(0)

print('No')

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

Solution (Python):
import sys
input=sys.stdin.readline

s = input().strip()
t = input().strip()

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

Solution (Python):
S = input()
T = input()
cnt = 0
s = S + S
ans=False
if S==T:
  ans=True
else:
  for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
        if (cnt%len(T))==0:
          ans=True
        cnt=0
          
if ans==True:
  print('Yes')
else:
  print('No')

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

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

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

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

Solution (Python):

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

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

flag = False

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

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

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

s2 = list(input())

ans = 'No'

for i in range(len(s1)):
  if ("".join(s1) == "".join(s2)):
    ans = 'Yes'
    break  
  last = s1.pop()
  s1.insert(0,last)
print(ans)

Solution (Python):

a = input()
b = input()
s = 0 
for i in range(len(a)):
    b = b[-1] + b[:-1]
    if a == b:
        s = 1
def Y(a,t = 0):
    if a==t : print('YES')
    else : print('NO')
def y(a, t =0):
    if a==t : print('Yes')
    else : print('No')
y(s,1)

Solution (Python):

a = input()
b = input()
s = 0 
for i in range(len(a)):
    b = b[-1] + b[:-1]
    if a == b:
        s = 1
def Y(a,t = 0):
    if a==t : print('YES')
    else : print('NO')
def y(a, t =0):
    if a==t : print('Yes')
    else : print('No')
y(s,1)

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

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

print(ans)

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

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

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


def main():
    S = INPUT()
    T = INPUT()
    N = len(S)

    for i in range(N):
        if S == T:
            print('Yes')
            sys.exit(0)
        else:
            S = S[N-1] + S[:N-1]

    print('No')


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

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

for _ in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit()
    else:
        S.insert(0, S[-1])
        S.pop(-1)

print("No")

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

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

print(ans)

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

Solution (Python):
S = input()
T = input()
s = []
t = []
n = len(S)
for i in range(n):
  s.append(S[i])
  t.append(T[i])
for i in range(n):
  if s == t:
    print('Yes')
    break
  zero = s[0]
  del s[0]
  s.append(zero)
else:
  print('No')

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

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

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

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

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

Solution (Python):
S = input()
T = input()
L = len(S)
f = False

for i in range(L):
  if S[i:]==T[:L-i] and S[:i]==T[L-i:]:
    f = True

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

Solution (Python):
import sys
S = input()
T = input()
if len(S)!=len(T):
    print('No')
    sys.exit()
S = S+S
for i in range(len(T)):
    flag = True
    for j in range(len(T)):
        if S[i+j] != T[j]:
            flag = False
    if flag:
        print('Yes')
        sys.exit()
print('No')

Solution (Python):
import sys

s=list(input())
t=list(input())
for i in range(len(s)):
    s.insert(0,s.pop())
    if s == t:
        print("Yes")
        sys.exit()

print("No")

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

flag = False

for i in range(1,len(S)+1):
    word = "".join(S[-i:]+S[:len(S)-i])
    if word == T:
        flag = True

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

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

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

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

def shift(l,n):
    return l[n:]+l[:n]
flag=True
for i in range(len(s)):
    if flag:
        if s==t:
            flag=False
            print('Yes')
        
        else:
            t=shift(t,1)

if flag:
    print('No')

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

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

print("No")

Solution (Python):
from collections import*
a=deque(input())
b=deque(input())
for i in range(len(a)):
	b.rotate()
	if a==b:
		print("Yes")
		exit()
print("No")

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

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

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

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

flag = 0
cnt = 0
while cnt <= len(s):
    if s == t:
        flag = 1
        break
    else:
        cnt += 1
        s = s[-1]+s[0:len(s)-1]

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

Solution (Python):
s = list(input())
t = input()
li = []
def rotate(l, n):
    return l[n:] + l[:n]
for i in range(len(s)):
    li.append("".join(rotate(s, i)))    
print("Yes" if t in li else "No")

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

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

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

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

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

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

Solution (Python):
s=list(input())
t=input()
l=len(s)
c=0

if "".join(s)==t:
    c=1
else:
    for i in range(l-1):
        n=s[-1]
        del s[-1]
        s.insert(0,n)
        if "".join(s)==t:
            c=1
            break
    
print("Yes" if c==1 else "No")

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

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

n = len(s)

ans = 'No'
for i in range(n):
    ok = True
    for j in range(n):
        if s[j] != t[(i+j)%n]:
            ok = False

    if ok:
        ans = 'Yes'

print(ans)

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

if a == b:
    print("Yes")
else:
    flag = False
    for i in range(1,len(a)):
        a_new = a[-i:] + a[:-i]
        if a_new == b:
            flag = True
            break
    if flag:
        print("Yes")
    else:
        print("No")

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

for i in range(len(s)):
    tmp = s[i:] + s[:i]
    if tmp == t:
        check  = 1

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

Solution (Python):
s = input().split()[0]
t = input().split()[0]

if set(s) != set(t):
    ans = 'No'
elif s == t:
    ans = 'Yes'
else:
    is_match = False
    for i in range(len(s)):
        part_1 = s[-i-1:]
        part_2 = s[:-i-1]
        
        work = part_1 + part_2
        if t == work:
            is_match = True
            break
    ans = 'Yes' if is_match else 'No'

print(ans)

Solution (Python):

s = input()
t = input()

res = False
for _ in range(len(s) + 1):
    s = s[1:] + s[0]
    if s == t:
        res = True

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

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

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

ans = 'No'

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

Solution (Python):
s=input()
t=input()
check=0
for i in range(len(s)):
    if s[i:]+s[:i] == t:
        check=1
print('Yes' if check==1 else '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):
i=input
a,b=i()*2,i()
print(["No","Yes"][b in a])

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

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

print('No')

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

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

flag = 0
for i in range(N):
    x = S.pop()
    S.insert(0,x)
    if S == T:
        flag = 1
        break

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

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    S = input()
    T = input()
    tmp = S
    for i in range(len(S)):
        tmp = tmp[-1]+tmp[:len(S)-1]
        if tmp == T:
            print('Yes')
            return
    print('No')
if __name__ == '__main__':
    main()

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

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

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

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

def solve():
    if(len(s)!=len(t)):
        print("No")
        return
    for i in range(len(s)):
        s.append(s.pop(0))
        if(s==t):
            print("Yes")
            return
    print("No")
    return

solve()

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

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

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

Solution (Python):
s=input()
t=input()
ds=["{}:{}".format(s[i],s[i-1]) for i in range(len(s))]
dt=["{}:{}".format(t[i],t[i-1]) for i in range(len(t))]
print("YNeos"[sorted(ds)!=sorted(dt)::2])

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b, c = LI()
    ans = 10 ** 5
    ans = min(ans, abs(a - b) + abs(b - c))
    ans = min(ans, abs(a - c) + abs(b - c))
    ans = min(ans, abs(a - c) + abs(a - b))
    print(ans)
    return


def B():
    s, t = S(), S()
    f = 0
    for i in range(len(s)):
        f = f or s[i:] + s[:i] == t
    print(["No","Yes"][f])
    return


def C():
    return


def D():
    return


if __name__ == '__main__':
    B()

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