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-----
kyoto
tokyo

-----Sample Output-----
Yes

 - In the first operation, kyoto becomes okyot.
 - In the second operation, okyot becomes tokyo.

Difficulty: introductory

Starter code:

Solutions:
# abc103
S = input()
T = input()
temp = S
for i in range(len(S)):
    if temp == T:
        print("Yes")
        return
    else:
        temp = temp[-1] + temp[:-1]
print("No")


# 初期入力
import sys

#input = sys.stdin.readline  #文字列では使わない
S =input().strip()
T =input().strip()
ans ="No"
for _ in range(len(S)):
    S =S[-1] +S[:-1]
    if S==T:
        ans ="Yes"
print(ans)

S = input()
T = input()

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

S = input()
T = input()
 
for i in range(len(S)):
    s = S[i:] + S[:i]
    if s==T:
        print('Yes')
        return
print('No')

def main():
    s = input()
    t = input()
    ans = 'No'
    s2 = s * 2
    for i in range(len(s2)):
        if t == s2[i:i + len(s)]:
            ans = 'Yes'
            break
    print(ans)



def __starting_point():
    main()
__starting_point()

import sys
s=input()
t=input()

s=list(s)
t=list(t)
u=s[:]

for i in range(len(s)):
    u.append(s[i])
    u.remove(u[0])
    if u==t:
        print('Yes')
        return
print('No')

import sys

S = input()
T = input()

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


s = input()
t = input()

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


s = input()
t = input()
res = "No"

def rotate(a):
  n = len(a)
  a = a[n-1] + a[:n-1]
  return a

for i in range(len(s)):
  if s == t:
    res = "Yes"
    break
  s = rotate(s)

print(res)

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s = S()
    t = S()
    l = len(s)
    s += s
    t += t
    flag = False
    for i in range(l):
        for j in range(l):
            if s[i:i+l] == t[j:j+l]:
                flag = True
    if flag:
        print("Yes")
    else:
        print("No")

main()



S = str(input())
T = str(input())

x = len(S)
for i in range(0, x):
    if S[i:] + S[:i] == T:
        print('Yes')
        return

print('No')


S = input()
T = input()

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

print(('No', 'Yes')[input() in input() * 2])

s = input()
t = input()

length = len(s)

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

S = input()
T = input()

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

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

print('No')

S = input()
T = input()

n = len(S)+1
while n:
    S = S[-1] + S[:-1]
    if S == T:
        print("Yes")
        return
    n -= 1
print("No")

s = input()
t = input()

s_num = len(s)
i = 0
a = 0
while i < s_num:
    if s == t:
        a = 1
    s = s[-1] + s[0:s_num-1]
    i = i + 1

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


S = input()
T = input()

characters_num = len(T)

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

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main(): 
    s = list(input().rstrip())
    t = input().rstrip()
    for i in range(len(s)):
        if t == "".join(s):
            print("Yes")
            return
        else:
            tmp=s.pop(0)
            s.append(tmp)
    print("No")



def __starting_point():
    main()
__starting_point()

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()
    T = SS()
    l = len(S)
    S2 = S * 2

    ans = 'No'
    for i in range(l):
        if S2[i:i+l] == T:
            ans = 'Yes'
            break

    print(ans)

def __starting_point():
    resolve()

__starting_point()

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

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

s=list(input())
t=list(input())

S=s+s
c=0

for i in range(len(s)):
  ch=0
  for j in range(len(s)):
    if S[i+j]==t[j]:
      ch+=1
  if ch==len(s):
    c+=1

if c>0:
  print('Yes')
  
else:
  print('No')



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

s = list(input())
t = list(input())

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

s=input()
t=input()

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


s = input()
t = input()

s = list(s)
t = list(t)

count = 0
judgment = 0

while count <= len(s):
    count +=1
    item = s.pop()
    s.insert(0,item)
    if s == t:
        judgment += 1

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

S = input()
T = input()

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


s = input()
t = input()

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

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

S = input()
T = input()

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



# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()
T = input()

# 求解処理
N = len(S)
ans = "No"
for i in range(N):
    if S[-i:] + S[:-i] == T:
        ans = "Yes"
        break

# 結果出力
print(ans)


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

import copy
s = list(input())
t = list(input())
bool = False
for i in range(len(s)):
    temp = copy.copy(s)
    if s == t:
        bool = True
    for j in range(len(s)):
        if j == 0:
            s[0] = temp[len(s) - 1]
        else:
            s[j] = temp[j - 1]
if bool:
    print('Yes')
else:
    print('No')

S = input()
T = input()
flag = False

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

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

str1 = input()
str2 = input()

print("Yes" if str2 in str1 * 2 else "No")

import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

s = input()
t = input()
n = len(s)

for i in range(n):
    flag = 0
    for j in range(n):
        if s[(i+j)%n] != t[j]:
            flag = 1
            break
    if flag == 0:
        print('Yes')
        return
print('No')

from itertools import groupby
class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i - 1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n - m] * self.finv[m] % self.mod) % self.mod
        
def iparse():
    return list(map(int, input().split()))


# RUN LENGTH ENCODING str -> tuple


def runLengthEncode(S: str):
    grouped = groupby(S)
    res = []
    for k, v in grouped:
        res.append((k, str(len(list(v)))))
    return res


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

__starting_point()

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

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

def answer(s: str, t: str) -> str:
    for i in range(len(s)):
        tmp = s[i:] + s[:i]
        if tmp == t:
            return 'Yes'
            break
    else:
        return 'No'

print((answer(s, t)))


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


S = input()
T = input()
String1 = list(S)
String2 = list(T)
N = len(String1)



for i in range(1,N):
    if String1 == String2:
        print("Yes")
        break
    Ex = String1.pop()
    String1.insert(0,Ex)
    if String1 == String2:
        print("Yes")
        break
else:
    print("No")

S = input()
T = input()
N = len(S)
for i in range(N-1,-1,-1):
    if S[:i] == T[N-i:] and S[i:] == T[:N-i]:
        print('Yes')
        return
print('No')


s = [a for a in input()]
t = [b for b in input()]
temp = None
for _ in range(len(s)):
  if s == t:
    print("Yes")
    return
  temp = s.pop(0)
  s.append(temp)
print("No")

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

s = input()
t = input()

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

S=input()
T=input()

def ans103(S:str, T:str):
    jugde_count=0
    for i in range(0,len(S)):
        S=S[-1]+S[:-1]
        if T==S:
            jugde_count+=1
    if jugde_count>0:
        return "Yes"
    else:
        return "No"

print(ans103(S,T))

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

    for index in range(x):
        if (s[index+1:] + s[:index+1]) == t:
            print("Yes")
            return

    print("No")


main()

s = list(input())
t = list(input())
ans = 'No'

for _ in s:
    tmp = s.pop()
    s.insert(0, tmp)
    ''.join(s)
    if s == t:
        ans = 'Yes'
        break

print(ans)

S = list(input())
T = list(input())
ans = 'No'

for i in S:
    tmp = S.pop()
    S.insert(0, tmp)
    ''.join(S)
    if S == T:
        ans = 'Yes'
        break

print(ans)






S = input()
T = input()

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        lstS = list(S)
        s = lstS.pop()
        a = list(s) + lstS
        S = ''.join(a)
        
else:
    print('No')

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

S = str(input())
T = str(input())

# 英小文字の文字列S を回転させて T に一致させられる場合は Yes、一致させられない場合は No を出力せよ。

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

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


s = input()
t = input()


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

        if st == t:
            print('Yes')
            return

print('No')

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

S = str(input())
T = str(input())
ans_list = []

for i in range(len(S)):
    i = S[-1] + S[0:-1]
    ans_list.append(i)
    S = i

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

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

match = 0

for _ in S:
    i = S.pop()  # 末尾を削除し値を取得
    S.insert(0, i)  # index[0]の位置にiを追加
    ''.join(S)  # リストを結合
    if S == T:
        match += 1
        break

if match == 0:
    print('No')
else:
    print('Yes')


S = input()
T = str(input())

s = list(S)
s_len = len(S)

i = 0

while i < s_len:
    s.insert(0, s[-1])
    s.pop(-1)
    new_s = "".join(s)
    i += 1
    if new_s == T:
        print("Yes")
        break
else:
    print("No")

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

S = input()
T = input()

success = 0

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

if success >= 1:
    print('Yes')
else:
    print('No')

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

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

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

S = input()
T = input()
N = len(S)

check = False
for i in range(N):
  S = S[-1] + S[:-1]
  if S == T:
    check = True

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

S = input()
T = input()

S_len = len(S)
S_change = ''
answer = 'No'

for _ in range(0, S_len):
    if S == T:
        answer = 'Yes'
        break

    S_change = S[-1]
    S = S[:-1]
    S = S_change + S

print(answer)

S = input()
T = input()
S = S + S

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

print("No")

S = input()
T = input()

if S == T:
    print("Yes")
else:
    ans = "No"
    S = list(S)
    for i in range(len(S)):
        s = S.pop()
        S.insert(0, s)
        if "".join(S) == T:
            ans = "Yes"
            break
    print(ans)

s = list(input())
t = list(input())

ans = "No"
for i in range(len(s)):
    s0 = s[0]
    s.remove(s0)
    s.append(s0)
    if s == t:
        ans = "Yes"
        break

print(ans)



s = input()
t = input()
# s,tをリストにする
s = list(s)
t = list(t)

# 変数count,judgementに0を代入
count = 0
judgment = 0

# sの長さだけ順番入れ替えを繰り返し
while count <= len(s):
    item = s.pop()
    s.insert(0,item)
    if s == t:
        # s==tになったらjudgmentでカウントアップ
        judgment += 1
    # 回数をカウントアップ
    count +=1

# 一回もs==tになってなければNo
if judgment == 0:
    print("No")
else:
    print("Yes")

S = input()
T = input()

# len:ﾘｽﾄの値（何文字入ってるか）の使う
# for i in range(): ()には繰り返したい回数を入れる。

for i in range(len(S)):
    if S[i:] + S[:i] == T:  # SとTに使われてるアルファべットが同じという証明
        print('Yes')
        return              
# elseでは出来なかった。一旦exitでる。
print('No')

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

original = input()
toVerify = input()

original = original * 3

if toVerify in original:
    print('Yes')
else:
    print('No')


s=input()
t=input()
n=0

for i in range(len(s)):
    a=len(s)-1


    s=s[a]+s[0:a]
  
    if s==t:
        n=1
        break
        
        
if n==1:
    if len(s)==len(t):
        print("Yes")
else:
    print("No")

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

import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
s = lines.pop(0)
t = lines.pop(0)
for i in range(len(s)):
    if s[i:] + s[:i] == t:
        print("Yes")
        break
else:
    print("No")


s,t=input(),input()
n=len(s)



ans="No"

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


print(ans)
    


def answer(s: str, t: str) -> str:
    for _ in range(len(s)):
        if t == s:
            return 'Yes'
        s = s[-1] + s[:-1]
    return 'No'


def main():
    s = input()
    t = input()
    print((answer(s, t)))


def __starting_point():
    main()

__starting_point()

s = str(input())
t = str(input())
N = len(s)
S = [0] * N
T = [0] * N

for i in range(N):
  S[i] = s[i]
  T[i] = t[i]
  
for i in range(N):
  for j in range(N):
    if j == 0:
      x = S[j]
      S[j] = S[j + 1]
    elif 1 <= j < N - 1:
      S[j] = S[j + 1]
    else:
      S[j] = x
  #print(S)    
  if S == T:
    print("Yes")
    return
    
print("No")    
      
      


s = input()
t = input()

def turn(S):
   return S[-1] + S[:-1]

for i in range(len(s)):
   if s == t:
      print('Yes')
      return
   else:
      s = turn(s)

print('No')

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

S = str(input())
T = str(input())

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

S=input()
T=input()

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


S = input()*2
T = input()

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

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

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

s = input()
t = input()

origin = s

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

s = s[1:] + s[0]



while (s != origin):
    if s == t:
        print("Yes")
        return
    s = s[1:] + s[0]

print("No")


S = input()
T = input()
r = 'No'
t2 = T + T

if set(S) == set(T):
  if t2.count(S) > 0:
    r = 'Yes'
else:
  r = 'No'
  
print(r)

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

# -*- coding: utf-8 -*-

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    S = input()
    T = input()

    return S, T


def main(S: str, T: str) -> None:
    """
    メイン処理.

    Args:\n
        S (str): 英子文字からなる文字列(2 <= |S| <= 100)
        T (str): 英子文字からなる文字列(|S| = |T|)
    """
    # 求解処理
    N = len(S)
    ans = "No"
    for i in range(N):
        if S[-i:] + S[:-i] == T:
            ans = "Yes"
            break

    # 結果出力
    print(ans)


def __starting_point():
    # 標準入力を取得
    S, T = get_input()

    # メイン処理
    main(S, T)

__starting_point()

s = input()
t = input()
a = len(s)
b = 0
for i in range(a):
    if s == t:
        b += 1
        break
    else:
        c = s[-1]
        s = c + s[:-1]

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

list_s = list(input())
list_t = list(input())
n = len(list_s)
for i in range(0, n):
    if "".join(list_s) == "".join(list_t):
        print("Yes")
        return
    list_s.insert(0, list_s[n - 1])
    list_s.pop(-1)
print("No")

S = input()
T = input()

num = len(T)

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

print(answer)

s = list(input())
t = list(input())
ans = 'No'

for _ in s:
    tmp = s.pop()
    s.insert(0, tmp)
    ''.join(s)
    if s == t:
        ans = 'Yes'
        break

print(ans)

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


string = input()
rotated_string = input()
for i in range(len(string)):
    string = string[-1] + string[0:-1]
    if string == rotated_string:
        print('Yes')
        return
print('No')


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

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


import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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












S = input()
T = input()

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