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

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(S: str, T: str):
    ret = NO
    n = len(S)
    for i in range(n):
        for j in range(n):
            if (S[i:n] + S[:i]) == T:
                ret = YES
                break
    print(ret)
    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()
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    print('No')

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance





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

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

    print('No')


if __name__ == '__main__':
    main()

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

while S != T:
  S = S[-1] + S[0:-1]
  cnt += 1
  if cnt >= 101:
    break
    
if S == T:
  print("Yes")
else:
  print("No")

Solution (Python):
s=list(str(input()))
t=list(str(input()))
n=len(s)
f=True
g=False
for i in range(n):
    f = True
    for j in range(n):
        if t[j]==s[(i+j)%n]:
            f = f and True
        else:
            f = False
    if f:
        g = g or f
if g:
    print("Yes")
else:
    print("No")

Solution (Python):

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

Solution (Python):
s=input()
t=input()
ans=False
for i in range(0,len(s)):
  if s==t:
    ans=True
  else:
    s=s[-1]+s[:-1]
if ans:
  print("Yes")
else:
  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):
S=list(input())
T=list(input())
for i in range(len(S)):
    s=S[-1]
    S.insert(0,s)
    S.pop()
    if S==T:
        print('Yes')
        break
else:
    print('No')

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

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

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

prev_T = T
result = 'No'

for i in range(len(T)):

    temp_T = prev_T[-1] + prev_T[0:-1]

    if temp_T == S:
        result = 'Yes'
        break

    prev_T = temp_T

print(result)

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

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

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

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

print('No')

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

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

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

Solution (Python):
import copy

S = input()
T = input()

ans = "No"
S_ = copy.deepcopy(S)
for s in range(len(S)):
    S_ = S_[-1] + S_[:-1]
    if S_ == T:
        ans = "Yes"

print(ans)

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

    flag = 0

    for i in range(len(s)):
        s = list(s)
        b = s[-1]
        for j in reversed(range(len(s))):
            s[j] = s[j-1]
        s[0] = b
        s = ''.join(s)
        if s == t:
            flag = 1
            break


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

if __name__=='__main__':
    main()

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

Solution (Python):
s=list(input())
t=list(input())
ans='No'
for i in range(len(s)+1):
    if s==t:
        ans='Yes'
        break
    s.insert(0,s.pop())
print(ans)

Solution (Python):

def main():
    origin = list(input())
    goal = list(input())
    flg = 0
    for i in range(len(origin)):
        pre = origin[:i]
        aft = origin[i:]
        now_data = aft + pre
        if now_data == goal:
            flg = 1
            break


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




if __name__ == '__main__':
    main()

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

Solution (Python):
import copy
s=list(input())
t=list(input())
ans=0
for _ in range(len(s)):
    s.insert(0,s[-1])
    del s[-1:]
    if s==t:
        ans=1
print('Yes' if ans==1 else 'No')

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

Solution (Python):
import sys
def check(i, s, t):
    new_t_list = t[i:] + t[:i]
    if new_t_list == s:
        return True
    else:
        return False

if __name__ == '__main__':
    s = input()
    t = input()
    s_head = s[0]
    for i in range(len(t)):
        if t[i] == s_head:
            b = check(i, s, t)
            if b:
                print("Yes")
                sys.exit()
    print("No")

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


if __name__ == "__main__":
  main()

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

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

Solution (Python):
def lis(n):
    m=[]
    for i in range(len(n)):
        m.append(n[i])
    return(m)


a=input()
b=input()
ans=0
new_list=lis(a)
for k in range(len(a)):
    l=new_list.pop(-1)
    new_list.insert(0,l)
    if new_list==lis(b):
        ans=+1
if ans==0:
    print("No")
else:
    print("Yes")

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

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

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

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

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

for _ in S:
    S.insert(0, S[-1])
    del S[-1]
    S_str = "".join(S)
    if S_str == T:
        print("Yes")
        exit(0)
print("No")

Solution (Python):

S=input()
S=list(S)
T=input()
Key=False

for i in range(len(S)):
    S=''.join(S)
    if S==T:
        Key=True
        break
    S=list(S)
    tmp=S[0]
    del S[0]
    S.append(tmp)
    

if Key==True:
    print('Yes')
else:
    print('No')

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

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

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

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

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

Solution (Python):
s=input();t=input();print('YNeos'[s not in[t[i:]+t[:i]for i in range(len(s))]::2])

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

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

for i in range(len(s)+1):
  if (s == t):
    print('Yes')
    exit()
  s.rotate(1)
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()
  else:
    continue

print('No')

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

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

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

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

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

YES = "Yes"  
NO = "No"  

def solve(S: str, T: str):
    SS = S + S
    for i in range(len(S)):
        if SS[i:i+len(S)] == T:
            return YES
    return NO


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)  
    result = solve(S, T)
    print(result)

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
import sys

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

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

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

print('No')

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

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

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

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

del(t[-1])
del(s[-1])


for _ in range(len(t)):
    temp = t[-1]

    for i in range(len(t)-1):
        t[-1 - i] = t[-2 - i]
    t[0] = temp

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

print('No')

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

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

Solution (Python):
import sys

s = input()
t = input()

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

print('No')

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

print("No")

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

Solution (Python):
s = input()
ss = input()
ss = ss + ss[0:-1]
if s in ss:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s = list(input())
t = list(input())
flg=1
for i in range(len(s)):
    flg=1
    for j in range(len(s)):
        num = i+j

        if num >= len(s):
            num -= len(s)

        if s[num] != t[j]:
            flg=0
            break
    
    if flg==1:
        break

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

Solution (Python):
import sys
def main():
  S = input()
  T = input()
  lenS = len(S)
  if S == T:
    print("Yes")
    sys.exit()
  for _ in range(lenS):
    tempS = S[-(lenS-1):] + S[0]
    if tempS == T:
      print("Yes")
      sys.exit()
    
    S = tempS
  print("No")

main()

Solution (Python):

s, t = [input().rstrip() for _ in range(2)]
lst_s = [i for i in s]
lst_t = [i for i in t]

if s == t:
    print("Yes")
else:
    for _ in range(len(s)):
        lst_s.insert(0, lst_s.pop())
        if lst_s == lst_t:
            print("Yes")
            break
    else:
        print("No")

Solution (Python):
import sys

S = str(input())
T = str(input())
n = 0

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

while n <= len(S) - 1:
    S = S[-1] + S[:-1]
    n += 1
    if S == T:
        print('Yes')
        sys.exit()
        
print('No')

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

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

Solution (Python):
S = input()
T = input()
def reverse(s):
    return s[-1] + s[0:-1]

count = 0
while True:
    if S == T:
        print("Yes")
        break

    S = reverse(S)
    count += 1
    if count == 1000:
    
        print("No")
        break

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

  t = ''.join(S)
  if t == T:
    print('Yes')
    return

  for _ in range(len(S)-1):
    last = S[-1]
    S.pop(-1)
    S.insert(0, last)
    t = ''.join(S)
    

    if t == T:
      print('Yes')
      return
      
  print('No')
  return

main()

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

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

Solution (Python):



s = input()
t = input()
i = 0
count = 0

while i < len(s):
    s = list(s)
    a = s.pop(0)
    s.append(a)
    s = ''.join(s)

    if s == t:
        count += 1

    i += 1


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

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

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

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

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

print("No")

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


if __name__ == '__main__':
	main()

Solution (Python):
import sys

l = list(input())
s = list(input())

for i in range(len(l)):
    if l == s:
        print("Yes")
        sys.exit(0)
    l = l[1:]+list(l[0])
print("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[0]
print(ans)

Solution (Python):


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

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

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

print(ans)

Solution (Python):
S = list(input())
T = list(input())
ans = 0
for i in range(len(S)):
  S.insert(0,S[-1])
  del S[-1]
  if S == T:
    ans += 1
print("Yes" if ans != 0 else "No")

Solution (Python):
def rot(s):
  ret = s[-1]+s[:-1]
  return ret

s1=input()
s2=input()

tmp=s1
flag=False

for i in range(len(s1)):
  tmp=rot(tmp)
  if tmp == s2:
    flag=True
    
if flag:
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):
S = list(input())
T = list(input())
n = len(S)
for i in range(n):
    if S == T:
        print('Yes')
        exit()
    string = S[-1]
    S.insert(0, string)
    del S[-1]
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):
S = input()
T = input()

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

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

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

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

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

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

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

Solution (Python):



s = input()
t = input()
i = 0
count = 0

while i < len(s):
    s = list(s)
    a = s.pop(0)
    s.append(a)
    s = ''.join(s)

    if s == t:
        count += 1

    i += 1


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

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

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

if f:
    print('Yes')
else:
    print('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 = list(input())
T = list(input())
for i in range(len(S)):
    if (S == T):
        print("Yes")
        exit()
    S.insert(0, S[-1])
    del S[-1]
print("No")

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

Solution (Python):

import sys
import itertools
import collections
import functools
import math
from queue import Queue
INF = float("inf")


def yes():
    print("Yes")  


def no():
    print("No")  


def solve(S: str, T: str):
    for i in range(len(S)):
        kari = S[i:]+S[:i]
        if kari == T:
            yes()
            return
    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()
for i in range(len(S)):
    if S[i] == T[0]:
        new_s = S[i:] + S[:i]
        if new_s == T:
            print("Yes")
            exit()
print("No")

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

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

Solution (Python):
S = [i for i in input()]
T = input()
S=S*2
if T in "".join(S):
    print("Yes")
else:
    print("No")

Solution (Python):




s = input()
t = input()


ans = "No"


for i in range(len(s)+1):
    ws = s[len(s)-1] + s[0:len(s)-1]
    s = ws

    if s == t:
        ans = "Yes"
        break


print(ans)

Solution (Python):
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) 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 MI(): return map(int, sys.stdin.readline().split())  
def II(): return int(sys.stdin.readline())  
def IS(): return input()  
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


s, t = IS(), IS()
for i in range(len(s)):
    a = [] 
    for j in range(len(s)):
        a.append(s[(i+j) % len(s)])
        if ''.join(a) == t:
            print('Yes')
            exit()
print('No')

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

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

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

ok = False
for i in range(len(s)):
  a = s[-1]
  s = s[:-1]
  s.insert(0, a)
  if s == t:
    ok = True
    break
if ok:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
s = str(raw_input())
t = str(raw_input())
if sorted(s) == sorted(t):
	for i in range(len(s)):
		s = s[1:] + s[0]
		if s == t:
			print 'Yes'
			sys.exit()
print 'No'

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

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

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

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

n = len(S)

ans = "No"

for i in range(n):
    m = S[-1]
    S = m + S
    S = S[:-1]
    
    if S == T:
        ans = "Yes"
        break

print(ans)

Solution (Python):
S = (input())
T = (input())
for i,c in enumerate(S):
    if T == S[i:] + S[:i]:
        print("Yes")
        break
else:
    print("No")

Solution (Python):
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    b=True
    break
if b==False:
  print("No")

Solution (Python):
s=input();t=input();print("YNeos"[all(s[i:]+s[:i]!=t for i in range(len(s)))::2])

Solution (Python):
s = list(input())
t = list(input())
f = False
for _ in range(len(s)):
    head = s.pop(-1)
    s.insert(0,head)
    if s == t:
        f = True

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

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

i = 0
while i < len(T):
    S = S[-1] + S[:-1]
    if S == T:
        print('Yes')
        break
    else:
        i += 1
if i == len(T):
    print('No')

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

Solution (Python):
from sys import stdin
S=(stdin.readline().rstrip())
T=(stdin.readline().rstrip())
if S == T:
    print("Yes")

else:
    flag=0
    moji=S
    for s in reversed(S):
        moji=s+moji[:-1]
        if moji == T:
            print("Yes")
            flag=1
            break
    if flag==0:
        print("No")

Solution (Python):
import sys

s=input()
t=input()
N=len(s)

for i in range(N):
    j=0
    for j in range(N):
        if t[-i+j]!=s[j]: break
        elif j==N-1:
            print("Yes")
            sys.exit()
    
    if i==N-1:
        print("No")
        sys.exit()

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

ans = "No"
l = len(s)

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

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




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

Solution (Python):
s=list(input())
t=list(input())
for i in range(len(s)):
    if s==t:
        print("Yes")
        exit()
    else:
        ss=[s[len(s)-1]]
        s.pop()
        ss.extend(s)
        s=ss
print("No")

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

Solution (Python):
s = list(input())
t = list(input())
c = 0
for a in range(len(s)):
    if s == t:
        c = 1
        break
    s.append(s[0])
    del s[0]
if c ==1:
    print("Yes")
    
else:
    print("No")

Solution (Python):
S = list(input())
T = list(input())
count = 0
for i in range(len(S)):
    if S == T:
        count += 1
    S.append(S[0])
    del S[0]
if count > 0:
    print("Yes")
else:
    print("No")

Solution (Python):

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

Solution (Python):



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

ans = False

for i in range(len(s)):
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

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