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

match = 0

for _ in S:
    i = S.pop()  
    S.insert(0, i)  
    ''.join(S)  
    if S == T:
        match += 1
        break

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

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

Solution (Python):
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)

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

Solution (Python):
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')

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

Solution (Python):


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)


if __name__ == "__main__":
    
    S, T = get_input()

    
    main(S, T)

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

Solution (Python):


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)

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
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')

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

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

Solution (Python):
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)

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

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


count = 0
judgment = 0


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


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

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

Solution (Python):
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')

Solution (Python):

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")
            exit()
        else:
            tmp=s.pop(0)
            s.append(tmp)
    print("No")



if __name__=="__main__":
    main()

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

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

    print("No")


main()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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)

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=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')

Solution (Python):
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))


if __name__ == '__main__':
    main()

Solution (Python):
str1 = input()
str2 = input()

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

Solution (Python):
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))

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

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

Solution (Python):
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
  
  if S == T:
    print("Yes")
    quit()
    
print("No")

Solution (Python):
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()))





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


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

Solution (Python):
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)

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

Solution (Python):
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')
        sys.exit()
print('No')

Solution (Python):
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)

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

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

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

Solution (Python):
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)

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

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

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):
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")
        exit()
    list_s.insert(0, list_s[n - 1])
    list_s.pop(-1)
print("No")

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

Solution (Python):
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)



if __name__ == '__main__':
    main()

Solution (Python):

import sys


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)

Solution (Python):
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)

Solution (Python):
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')
        exit()
print('No')

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

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

Solution (Python):
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")
        exit()

print("No")

Solution (Python):
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)

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()
l = len(S)
f = 0
for i in range(l):
  P = str(S[-1]) + S[:-1]
  if P == T:
    print("Yes")
    f = 1
    break
  S = P
if f == 0:
  print("No")

Solution (Python):
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')

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

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

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

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

Solution (Python):

S = input()
T = input()

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

Solution (Python):
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')

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

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

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

Solution (Python):
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')

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

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

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

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

print('No')

Solution (Python):
from sys import exit
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')
        exit()
print('No')

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

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

Solution (Python):
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)

if __name__ == '__main__':
    resolve()

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

Solution (Python):

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

Solution (Python):
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: 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')
        exit()
    else:
        s = s[-1] + s[:-1]
print('No')

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

if __name__ == "__main__":
    solve()

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

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


if __name__ == "__main__":
    main()

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

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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
s = list(input())
t = list(input())
cnt = 0
for i in range(len(s)):
    x = t[-1]
    t.pop()
    t.insert(0, x)
    if s == t:
        print("Yes")
        break
    else:
        cnt += 1
        if cnt == len(s):
            print("No")
            break

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

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    l = len(S)

    def judge():
        for i in range(l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False

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

if __name__ == '__main__':
    main()

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 = input()
t = input()
for i in range(len(s)):
    if s[i:]+s[:i]==t:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
S=input()
T=input()
n=len(S)
s,t=[],[]
for i in range(n):
  s.append(S[i])
  t.append(T[i])
for i in range(n):
  p=s[0]
  for j in range(1,n):
    s[j-1]=s[j]
  s[n-1]=p
  if s==t:
    print('Yes')
    exit()
print('No')

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

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

else:
  print("No")

Solution (Python):
def role(s:str):
    s0, s1 = s[:len(s)-1], s[len(s)-1]
    return s1 + s0

def main():
    s = input()
    t = input()
    for _ in range(len(t)):
        if s == t:
            print('Yes')
            return
        s = role(s)
    print('No')

if __name__ == "__main__":
    main()

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

u = deque(s)
ok = False
for i in range(len(s)):
  u.rotate(1)
  if ''.join(u) == t:
    ok = True
    
print('Yes' if ok else 'No')

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

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

if S in T1:
  print('Yes')
else:
  print('No')

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

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

print("Yes") if cnt > 0 else print("No")

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

print(c)

Solution (Python):
a = input()
b = input()
c = b * 2
if a in c:
  print("Yes")
else:
  print("No")

Solution (Python):
from collections import deque
s = deque(input())
t = deque(input())
for i in range(len(s)):
    if s == t:
        print("Yes")
        exit()
    s.append(s[0])
    s.remove(s[0])
print("No")

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

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

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

for _ in range(len(S)):
    c = S.pop(0)
    S.append(c)
    if S == T:
        print('Yes')
        exit()

print('No')

Solution (Python):
S = input().rstrip()
T = input().rstrip()
flg = False
for i in range(len(S)):
    cnt = 0
    for j, s in enumerate(S):
        if s==T[j-i]: cnt += 1
    if cnt==len(S):
        flg = True
if flg:
    print("Yes")
else:
    print("No")

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


def read():
    S = input().strip()
    T = input().strip()
    return S, T


def solve(S, T):
    N = len(S)
    for i in range(N):
        is_matched = True
        for j1 in range(N):
            j2 = (i + j1) % N
            if S[j1] != T[j2]:
                is_matched = False
                break
        if is_matched:
            return "Yes"
    return "No"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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

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

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

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

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

S_new=S

ans="No"

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

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

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

S_new=S

ans="No"

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

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

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

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


u = s + s

flag = False
j = 0

for i in range(len(u)):
    if u[i] == t[j]:
        j += 1
        if j == len(t):
            flag = True
            break
    else:
        j = 0

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

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

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

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

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

Solution (Python):
S = list(input())
T = list(input())
for i in range(len(S)):
    T.insert(0, T.pop(-1))
    if S == T:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
S = input()
T = input()
n = len(S)
s = []
t = []
for i in S:
  s.append(i)
for i in T:
  t.append(i)
  
for i in range(n):
  res = s[0] 
  for j in range(1, n):
    s[j-1] = s[j]
  s[n-1] = res
  if s == t:
    print('Yes')
    exit()
    
print('No')

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

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
else:
    print("No")

Solution (Python):
def kaiten(x):
    a=x[:-1]
    x=x[-1:]
    return x+a


S=str(input())
T=str(input())
ans="No"
for i in range(len(S)):
    if S==T:
        ans="Yes"
        break
    S=kaiten(S)

print(ans)

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

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

print("No")

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

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

else:
    print("No")

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

Solution (Python):
from collections import deque 
S = deque(input())
T = input()

result = 'No'
for i in range(len(S)):
    a = S.pop()
    S.appendleft(a)
    if ''.join(S) == T:
        result = 'Yes'
        break
print(result)

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

s = S
for i in range(S_len):
    s_list = list(s)
    s_end = s_list.pop()
    b = s_end + ''.join(s_list)
    if b == T:
        print('Yes')
        exit(0)
    s = b
print('No')

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

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

for i in range(len(s)):
    S = s[-(i+1):]+s
    if S[:len(s)] == t:
        print('Yes')
        exit()
    
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):




def resolve():
    import sys
    input = sys.stdin.readline
    s = input().rstrip()
    t = input().rstrip()

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

    print("No")

if __name__ == "__main__":
    resolve()

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

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


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


if __name__ == '__main__':
    main()

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

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

for _ in range(len(S) + 1):
    if S == T:
        print("Yes")
        break
    S.append(S.pop(0))
else:
    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")
    break
else:
  print("No")

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

flag = False
count = 0
while True:
    if S == T:
        flag = True
        break

    if count == len(S):
        break
    
    S = S[-1] + S[:len(S) - 1]
    count += 1

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()
    T = readline().strip()

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

    print('No')
    return


if __name__ == '__main__':
    main()

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

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

Solution (Python):









s = input()
t = input()


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