Problem:
 Score : 200 points    Problem Statement You are given string S and T consisting of lowercase English letters.  Determine if S equals T after rotation .  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|} . Change S to S_{|S|} S_1 S_2 ... S_{|S|-1} .  Here, |X| denotes the length of the string X .      Constraints  2 \leq |S| \leq 100  |S| = |T|  S and T consist of lowercase English letters.         Input Input is given from Standard Input in the following format:  S  T       Output If S equals T after rotation , print Yes ; if it does not, print No .        Sample Input 1 kyoto
tokyo      Sample Output 1 Yes   In the first operation, kyoto becomes okyot .  In the second operation, okyot becomes tokyo .        Sample Input 2 abc
arc      Sample Output 2 No  abc does not equal arc after any number of operations.       Sample Input 3 aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab      Sample Output 3 Yes

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

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

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

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

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

Solution (Python):
from collections import deque
S=deque(input())
T=deque(input())
for i in range(len(T)):
  if S==T:
    print("Yes")
    exit()
  t=T.pop()
  T.appendleft(t)
print("No")

Solution (Python):
import sys

def resolve():
    S = input()
    T = input()
    allS = []
    for i in range(len(S)):
        allS.append(S[i:]+S[:i])
    if T in allS:
        print("Yes")
    else:
        print("No")

if '__main__' == __name__:
    resolve()

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

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

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

Solution (Python):
Slist=list(input())
Tlist=list(input())

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

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

Solution (Python):
import sys
input = sys.stdin.readline
s = input()[:-1]
t = input()[:-1] 


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

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

Solution (Python):
worda = input()
wordb = input()
for i in range(len(wordb)):
    if worda == wordb[-i:] + wordb[:-i]:
        dst = "Yes"
        break
else:
    dst = "No"
print(dst)

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    s = input()
    t = input()

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

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  s = input()
  t = input()
  cnt = 0
  sl = len(s)
  for i in range(sl):
    s = s[sl-1] + s[:sl-1]
    if s == t:
      print('Yes')
      exit()
  print('No')
  
  
if __name__ == '__main__':
  main()

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

Solution (Python):
S = str(input())
T = str(input()) 
s = list(S)
t = list(T)
p = 1
for i in range(len(s)):
    if s == t:
        p = p*0
    else:
        p = p*1
    s.insert(0,s[len(s)-1])
    del s[len(s)-1]
if p == 0:
    print('Yes')
else:
    print('No')

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

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

    d = deque(S)
    for _ in range(len(S)):
        d.appendleft(d.pop())
        if list(d) == T:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    solve()

Solution (Python):
from collections import deque

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

for _ in range(n):
    a = s.pop()
    s.appendleft(a)
    ss = "".join(s)
    if ss == t:
        print("Yes")
        exit()
else:
    print("No")

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

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

Solution (Python):
list_S = list(input())
list_T = list(input())
ans = "No"

for i in range(len(list_S)):
    k = list_S.pop(0)
    list_S.append(k)
    if list_S == list_T:
        ans = "Yes"

print(ans)

Solution (Python):
s = input()
t = input()
print("YNeos"[s not in t*3::2])

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

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

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

print(ans)

Solution (Python):
def splitmozi(n , s):

    spmozi = ""
    s = list(map(str , s))

    for i in range(len(s)):
        spmozi += s[(-n) + i]

    return spmozi

def String_Rotation(s , t):

    ans = "No"
    for i in range(len(s)):
        spmozi = splitmozi(i , s)
        if spmozi == t:
            ans = "Yes"

    return ans

def main():
    s = str(input())
    t = str(input())
    print(String_Rotation(s , t))

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
t = input()
s_list = list(s)
flg = False
for i in range(len(s)):
    s_list.insert(0,s_list[-1])
    del s_list[-1]
    if "".join(s_list) == t:
        print('Yes')
        flg = True
        break
        
if not flg:
    print('No')

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

Solution (Python):

s1 = list(input())
s2 = list(input())
for i in range(len(s1)):
    if s1 == s2:
        print("Yes")
        exit()
    temp = s2[0]
    for j in range(1, len(s1)):
        s2[j - 1] = s2[j]
        if j == len(s2) - 1:
            s2[j] = temp
print("No")

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

for i in range(n):
    f  = False
    for j in range(n):
        if t[j] == s[(i+j)%n]:
            pass
        else:
            break
    else:
        f = True
        break
if f:
    print("Yes")
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")
    exit()
print("No")

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


for i in S:
    if S == T:
        print("Yes")
        break
    else:
        S_pop = S.pop(len(S)-1)
        S.insert(0, S_pop)
        
if not S==T:
    print("No")

Solution (Python):

from collections import deque
s = deque(input())
t = deque(input())

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

Solution (Python):
import math

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

ok=False

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

    if(tmp):
        ok=True


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

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

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

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

import sys

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

Solution (Python):


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


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

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

    print("No")



if __name__ == "__main__":
    solve()

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    S = input().strip()
    T = input().strip()
    for i in range(len(S) + 1):
        temp=""
        for j in range(len(S)):
            temp += S[(j+1) % len(S)]
        S=temp
        if T==temp:
            print("Yes")
            return
    print("No")
    return


if __name__ == '__main__':
    main()

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

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

print('No')

Solution (Python):
s = list(input())
t = list(input())
c = 0
for i in range(len(s)):
    p = s.pop()
    s.insert(0, p)
    if s == t:
        c = 1
        break
print("Yes" if c == 1 else "No")

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

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    T = iss()

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

    print('No')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
T = input()
S = S * 2
yes = S.find(T) != -1
print('Yes' if yes else 'No')

Solution (Python):
from collections import deque

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

yes = False
for _ in range(n):
    if s == t:
        yes = True
        break
    s.rotate()

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

Solution (Python):
s=input()
t=input()
flag=False
for _ in range(128):
  s=s[1:]+s[0]
  flag|=(s==t)
print("Yes" if flag else "No")

Solution (Python):
import sys

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

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

def rolling(x):
    return x[-1] + x[:-1]

cnt = 0
while s != t and cnt < len(s):
    s = rolling(s)
    cnt += 1

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

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

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

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

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys


def main():
    ss = input()
    ts = input()
    n = len(ss)

    for i in range(n):
        ss = ss[-1] + ss[:-1]
        if ss == ts:
            print('Yes')
            sys.exit(0)

    print("No")

if __name__ == "__main__":
    main()

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

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

Solution (Python):
S = input()
T = input()
ans = "No"
def rot(s):
    return s[len(s)-1] + s[0:len(s)-1]
s = rot(S)
while(s != S):
    if (s == T):
        ans = "Yes"
        break
    s = rot(s)

if (s == T):
    ans = "Yes"
print(ans)

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):
from collections import deque

s=deque(input())
t=deque(input())

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

for i in range(len(s)):
    s.rotate()
    
    if s==t:
        print("Yes")
        exit()

print("No")

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

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

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

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

a = len(s)
b = "No"

x = a
for _ in range(a):
  x =s[0]
  for i in range(a-1):
    s[i]=s[i+1]
  s[-1]=x
  s = "".join(s)
  if s==t:
    b='Yes'
    break
  else:
    s = list(s)
print(b)

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

for k in range(len(S)):
    for i in range(len(S)):
        if S[i] == T[i - k]:
            continue
        else:
            break
    else:
        ans = 'Yes'
        break
else:
    ans = 'No'

print(ans)

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()
l = []
cnt = 0
for i in s:
    l.append(i)
for j in range(len(s)):
    l.insert(0, l[len(s) - 1])
    
    
    
    if "".join(l[:len(s)]) == t:
        cnt += 1
if cnt >= 1:
    print("Yes")
else:
    print("No")

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

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

L = len(S)

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

answer = 'Yes' if bl else 'No'
print(answer)

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

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

def same(s1,s2):
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            return False
    return True

for i in range(111):
    if same(s,t):
        print("Yes")
        exit()

    tmp = s.pop(0)
    s.append(tmp)

print("No")

Solution (Python):
s = input(); t = input()
c = 0 
     
while (s != t):
	s = s[-1] + s[:-1]
	c += 1
	if c == len(s):
		print('No')
		break
        
if s == t:
	print('Yes')

Solution (Python):
from collections import deque
s=deque(input())
t=input()
for _ in range(len(t)+2):
  if ''.join(s)==t:
    print('Yes')
    exit()
  s.appendleft(s[-1])
  s.pop()
print('No')

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

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

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

S = ns()
T = ns()
N = len(S)
flag = False

for i in range(N + 1):
    q = S[:i]
    p = S[i:]
    if p + q == T:
        flag = True
    
print("Yes" if flag else "No")

Solution (Python):
s = input(); t = input()
c = 0 

while (s != t):
    s = s[-1] + s[:-1]
    c += 1
    if c == len(s):
        print('No')
        break
    
if s == t:
    print('Yes')

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

Solution (Python):
from collections import deque
s = deque(input())
t = input()
ans = 'No'
for i in range(len(s)):
  s.appendleft(s.pop())
  string = ''.join(s)
  if string == t:
    ans = 'Yes'
print(ans)

Solution (Python):
s = input()
t = input()
if(s == t):
    print("Yes")
    exit()

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

print("No")

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

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

Solution (Python):
a =input()
a = [str(c) for c in a]
b =input()
b = [str(c) for c in b]

c=len(b)
t=0
for i in range(0,c+3):
	a.append(a[0])
	del a[0]
	if a==b:
		t=1
		
if t==1:
	print('Yes')
else:
	print('No')

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

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

Solution (Python):
from collections import deque
s=deque(list(input()))
t=deque(list(input()))
for i in range(120):
  s.rotate(1)
  if s==t:
    print("Yes")
    exit()
print("No")

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

lang = len(s) - 1

for i in range(len(s)):
    sub = s[lang]
    del s[lang]
    s.insert(0, sub)
    if s == t:
        print("Yes")
        exit()

print("No")

Solution (Python):





from collections import Counter, deque


def resolve():
    s=deque(list(input()))
    t=deque(list(input()))

    for i in range(len(s)):
        s.rotate()
        if s==t:
            print('Yes')
            break
        if i ==len(s)-1:
            print('No')
            break


resolve()

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

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

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

Solution (Python):
import sys
i = list(input())
t = list(input())
for _ in range(len(i)):
  if i == t:
    print("Yes")
    sys.exit()
  else:
    e = i.pop(-1)
    i.insert(0, e)
print("No")

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = list(input())
n = len(s)
t = list(input())
for i in range(n+5):
    now = []
    now.append(s[-1]); s.pop(-1) 
    now += s
    s = now
    if s == t:
        print('Yes')
        break
else:
    print('No')

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


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


def has_duplicates2(seq):  
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


s = input()
t = input()




def rotate(s):
    a = []
    a.append(s[-1])
    a.append(s[:-1])
    return ''.join(a)


def solve(r):
    if r == s:
        return False
    if r == t:
        return True
    return solve(rotate(r))


if s == t:
    print("Yes")
    exit()
if solve(rotate(s)):
    print("Yes")
else:
    print("No")

Solution (Python):

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

Solution (Python):
print("YNeos"[input() not in input()*2::2])

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

Solution (Python):


S = input()
T = input()
is_same = False

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

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

Solution (Python):
import sys

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

    return 0

if __name__ == "__main__":
    solve()

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

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

print("No")

Solution (Python):
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


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

Solution (Python):

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

n = len(s)
flag2 = 0
for i in range(n):
    flag = 0
    for j in range(n):
        index = min(i + j, i + j - n)
        if s[index] == t[j]:
            flag += 1
    if flag == n:
        print("Yes")
        exit()
    else:
        flag2 += 1
if flag2 == n:
    print("No")

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

ans = "Yes"
if S != T:
  for _ in range(len(S)):
    a = S[-1]
    S.pop(-1)
    S.insert(0, a)
    if S == T: break
  if S != T: ans = "No"

print(ans)

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

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

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

Solution (Python):
S = list(input())
T = list(input())
len_T = len(T)
for _ in range(len_T):
    if S == T:
        print("Yes")
        exit()
    else:
        tmp = T.pop(0)
        T.append(tmp)
print("No")

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

Solution (Python):
s = list(str(input()))
t = list(str(input()))
l = len(s)
for i in range(l):
    if s == t:
        print('Yes')
        exit()
    tmp = s[l-1]
    s = s[:l-1]
    s.insert(0, tmp)
print('No')

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

ans=0
for i in range(n):
    for j in range(n):
        if s[(i+j)%n]!=t[j]:
            break
        if j==n-1:
            ans=1

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

Solution (Python):
from sys import stdin
def main():
	readline=stdin.readline
	S=readline().strip()
	T=readline().strip()
	for i in range(len(S)):
		U=S[i:]+S[:i]
		if U==T:
			print("Yes")
			break
	else:
		print("No")
if __name__=="__main__":
	main()

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


if __name__ == '__main__':
    main()

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(S: str, T: str):
    f = False
    n = len(S)
    for i in range(n):
        if S[n-i:]+S[:n-i] == T:
            f = True

    if f:
        print(YES)
    else:
        print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    solve(S, T)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
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=(input())
t=(input())
ss=s+s
n=len(s)
flag=False
for i in range(0,n):
    if ss[i:i+n]==t:
        print("Yes")
        sys.exit()
print("No")

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

ans = "No"
for i in range(len(S)+1):
    tmp = S.pop(0)
    S.append(tmp)
    
    if S == T:
        ans = "Yes"
        break

print(ans)

Solution (Python):


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

Solution (Python):
from collections import deque


def main():
    S = deque(list(map(str, input())))
    T = input()

    for _ in range(len(S)):
        if "".join(S) == T:
            print("Yes")
            return
        else:
            s = S.pop()
            S.appendleft(s)

    print("No")


if __name__ == "__main__":
    main()

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

Solution (Python):
S = input()*2
T = input()
print("Yes" if S.count(T) > 0 else "No")

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

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

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

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

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

Solution (Python):



def can_match():
    s = input().rstrip()
    t = input().rstrip()
    if s == t:
        return True
    for i in range(1, len(s)):
        tmp = s[i:] + s[0:i]
        if tmp == t:
            return True
    return False


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