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



Sample input:
kyoto
tokyo


Sample output:
Yes

Submission status: Accepted

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

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

solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
T = input()
def_S = S

while(1):
    S = S[-1] + S[0:-1]
    if S == T:
        print("Yes")
        os.sys.exit()
    if def_S == S:
        print("No")
        os.sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

can = False
for i in range(len(s)):
    if s == t:
        can = True
        break
    slist = list(s)
    tmp = slist[0]
    del(slist[0])
    slist.append(tmp)
    s = ''.join(slist)

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

Submission status: Accepted

Solution code:
S = list(input())
T = input()
s_tmp = S.copy()
if ''.join(S) == T:
  print('Yes')
else:
  while True:
    s_reversed = s_tmp[:-1]
    s_reversed.insert(0, s_tmp[-1])
    if ''.join(s_tmp) == T:
      print('Yes')
      break
    elif S == s_reversed:
      print('No')
      break
    s_tmp = s_reversed

Submission status: Accepted

Solution code:
s = input().rstrip()
t = input().rstrip()
s = s + s
print('No') if s.find(t) == -1 else print('Yes')

Submission status: Accepted

Solution code:
s = input().rstrip()
t = input().rstrip()
s = s + s
print('No') if s.find(t) == -1 else print('Yes')

Submission status: Accepted

Solution code:
S = input()
T = input()
S_list = []
T_list = []
n = 0
for i in range(len(S)):
    S_list.append(S[i])
    T_list.append(T[i])
for j in range(len(S)):
    if S_list == T_list:
        n = 1
        break
    else:
        a = T_list[0]
        T_list.append(a)
        T_list.remove(a)
if n == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# ABC 103, B - string rotation
s = list(input())
t = list(input())

for i in range(len(s)):
    if s == t:
        print('Yes')
        break
    tmp = s.pop()
    s.insert(0, tmp)

else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

b = s * 2

if t in b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

length = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()*100
t=input()

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

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

    t2 = t + t

    print("Yes" if t2.count(s) >= 1 else "No")

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
tmp = s[:]
ans = 'No'
for i in range(len(s)):
    _tmp = list(tmp.pop(-1))
    for j in range(len(tmp)):
        _tmp.append(tmp[j])
    if _tmp == t: ans = 'Yes'
    tmp = _tmp[:]
print(ans)

Submission status: Accepted

Solution code:
s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    c = 0
print('YNeos'[c::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy
s = input()
t = input()
flag = True
listed_s = list(s)
swaped_s = list(s)
for i in range(len(s)):
    if ("".join(listed_s) == t) and (flag):
        flag = False
        print("Yes")
    swaped_s = [listed_s[-1] for i in range(len(s))]
    for i in range(len(s) - 1):
        swaped_s[i + 1] = listed_s[i]
    listed_s = copy.copy(swaped_s)
    if ("".join(listed_s) == t) and (flag):
        flag = False
        print("Yes")

if flag:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = input()
t = input()

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

Submission status: Accepted

Solution code:
from collections import deque
S = deque(list(input()))
T = deque(list(input()))
count = 0
if S==T:
    print("Yes")
else:
    for _ in range(len(S)-1):
        s = S.pop()
        S.appendleft(s)
        if S==T:
            count += 1
    if count>0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

flag = False

def rotate_string(string):
  return "".join((string[-1], string[:-1]))

# print(S)
# print(rotate_string(S))
if S == T:
  print("Yes")
  flag = True

for i in range(len(S)):
  S = rotate_string(S)
  if S == T:
    if not flag:
      print("Yes")
      flag = True
      break
    
if not flag:
  print("No")

Submission status: Accepted

Solution code:
s1=str(input())
s2=str(input())
n=len(s2)
for i in range(n):
    if s1==s2:
        print("Yes")
        exit()
    else:
        s2=s2[-1]+s2[:n-1]
print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC103 B

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

for i in range(len(s)):
    x = s.pop()
    s.insert(0,x)
    if s == t:
        print('Yes')
        quit()
print('No')

Submission status: Accepted

Solution code:
a = input()
b = input()
c = 0

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

Submission status: Accepted

Solution code:
import sys
listS=list(input())
listT=list(input())
LEN=len(listS)
for i in range(LEN):  
  listS.insert(0,listS[LEN-1])
  del listS[LEN]
  if listS==listT:
    print("Yes")
    sys.exit()
print("No")

Submission status: Accepted

Solution code:

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)):
        if s != t:
            s_list = list(s)
            temp = s_list.pop(len(s)-1)
            s = ''.join(s_list)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s1 = input()
s2 = input()
if (s1 + s1).find(s2) >= 0:
  print("Yes")
  quit()

print("No")

Submission status: Accepted

Solution code:
s = input()
t = input()
flag = False
for i in range(len(s)):
    flagi = True
    for j in range(len(s)):
        if(s[j] != t[(i+j) % len(s)]):
            flagi = False

    if(flagi):
        flag = True
if(flag):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print("No")

Submission status: Accepted

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

cnt=0
while True:
    if s==t:
        print("Yes")
        break
    
    elif cnt==len(s)-1:
        print("No")
        break
    
    ans1=s[-1]
    ans2=s[:-1]
    ans=ans1+ans2
    s=ans
    cnt+=1

Submission status: Accepted

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

for i in range(len(S)):
    if S == T:
        print("Yes")
        break

    T = T[-1] + T[:-1]

else:
    print("No")

Submission status: Accepted

Solution code:
s, t = (input() for i in range(2))

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

Submission status: Accepted

Solution code:
s=input()
s2=input()

s_len=len(s)

res='No'

s_mod=s

if s_mod==s2:
  res='Yes'
else:
	for i in range(1,s_len+1):
		s_mod=s_mod[-1]+s_mod[:-1]
		if s_mod==s2:
			res='Yes'
			break

print(res)

Submission status: Accepted

Solution code:
s = input()
t = input()
u = s+s
if t in u:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
t = input()
cnt = 1
for _ in range(len(s)):
    a = s[len(s)-1]
    b = [s[i] for i in range(len(s)-1)]
    bb = "".join(b)
    s = a+bb
    if s == t:
        cnt *= 0

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

Submission status: Accepted

Solution code:
import sys
s = input()
t = input()
for i in range(len(t)):
    l = t[i:]+t[:i]
    if s==l:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = input()
print('Yes' if (s+s).count(t)>0 else 'No')

Submission status: Accepted

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

N = len(S)

flag = False
for i in range(N):
  for j in range(N):
    if S[i+j-N] != T[j]:
      break
    if j == N-1:
      flag = True

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

Submission status: Accepted

Solution code:
a = input()
b = input()
#print(b)
def rec(a,b,c):
    if c==len(b)+1:
        return False
    if b == a:
        return True
    newb = b[len(b)-1]+b[0:-1]
    c+=1
    return rec(a,newb,c)
    

if rec(a,b,0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
def check(S, T):
    for _ in range(len(S)):
        if S == T:
            return True
        S = S[-1] + S[:-1]
    return False


def main():
    S = input()
    T = input()
    if check(S, T):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

S = s()
T = s()

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

print('No')

Submission status: Accepted

Solution code:
import sys
S = input()
T = input()
flag = 0
for i in range(len(S)): #i番目まで
    st1 = S[:i+1]
    st2 = S[i+1:]
    st3 = T[-i-1:]
    st4 = T[:-i-1]
    if st1 == st3 and st2 == st4:
        flag = 1
if flag == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()
T = input()
n = len(S)

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

Submission status: Accepted

Solution code:
S = input()
T = input()
N = len(S)
flag = False

for i in range(N):
    t = S[-1] + S[:-1]
    S = t
    if t == T:
        flag = True
        break

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

Submission status: Accepted

Solution code:

S = input()
T = input()


bul = "No"
for i in range(len(S)):

    if S == T:
        bul = "Yes"
        break

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

print (bul)

Submission status: Accepted

Solution code:
s = input()
t = input()
if s == t:
    print('Yes')
    exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input() * 2
t = input()

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

Submission status: Accepted

Solution code:
import numpy as np

S_line = input()
T_line = input()

length = len(S_line)

index_list = []
def index_maker(start_n, length):
    for loc in range(length):
        if loc > start_n:
            index_list.append(loc)
        
    for loc in range(start_n + 1):
        #print(str(start_n) +":"+ str(loc))
        index_list.append(loc)
    if start_n + 1 == length:
        return list(range(length))

    return(index_list)

ac_flag = 0
index_list = []
y_flag = 0

for i in range(length):
    index_list = index_maker(length-1 - i, length)
    #print(index_list)
    for i, index in enumerate(index_list):
        #print("i: " + str(i) +" index: "+ str(index))
        if T_line[i] != S_line[index]:
            ac_flag += 1
    if ac_flag == 0:
        y_flag += 1
    ac_flag = 0
    index_list = []

if y_flag != 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input().rstrip()
t = input().rstrip()

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

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

Submission status: Accepted

Solution code:
s = list(input())
t = input()
flag = 0
  
for i in range(len(s)):
  tmp = s.pop(-1)
  s.insert(0, tmp)
  if "".join(s) == t:
    print("Yes")
    flag = 1
    break

if flag == 0:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
T = input()
l = len(S)
for i in range(l):
    if S[:i] == T[l-i:] and S[i:] == T[:l-i]:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
def abc():
    s = list(input().rstrip())
    t = list(input().rstrip())

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


abc()

Submission status: Accepted

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

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    elif S != T:
        S.insert(0,S[-1])
        del S[-1]
    if i == len(S)-1:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
T = input()
n = len(S)

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

Submission status: Accepted

Solution code:
# coding: utf-8
import time
import re
import math

def main():
    s=input()
    t=input()
    f=0
    for a in range(len(s)):
        if s==t:
            f=1
        s=s[-1]+s[0:-1]
    if(f==1):print("Yes")
    else:print("No")


main()

Submission status: Accepted

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

original = a
lengtha = len(a)

if a == b:
        print("Yes")
        quit()

for i in range(lengtha):
        a = a[-1] + a[0:-1]
        if a ==b:
                print("Yes")
                quit()

print("No")

Submission status: Accepted

Solution code:
s = input()
t = input()
#print(s, t)
ans = "No"
c = len(s)
for i in range(c):
  for j in range(c):
    si = s[(j+i)%c:(j+i)%c+1]
    tj = t[j:j+1]
    #print(i, j, si, tj)
    if si != tj:
      break
  else:
    ans = "Yes"
    break
    
print(ans)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

S = sys.stdin.readline().rstrip()
T = sys.stdin.readline().rstrip()

a = T + T
ok = False
for i in range(len(S)):
    ok |= a[i:len(S)+i] == S

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
if sorted(s) != sorted(t):
  print('No')
else:
  msg = 'No'
  for i in range(len(s)):
    ss = s[i:] + s[:i]
    if ss == t:
      msg = 'Yes'
      break
  print(msg)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = input()
flag = False

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# INPUT
# 普通の入力
s = input()
t = input()

# PROCESS
def round(s_local):
  s_list = list(s_local)
  last_letter = s_list.pop(0)
  s_list.append(last_letter)
  return "".join(s_list)

answer = "No" 
for i in range(len(s)):
  s = round(s)
  if (s == t):
    answer = "Yes"
    break


# OUTPUT
print(answer)

Submission status: Accepted

Solution code:
from collections import deque

S = deque(input())
T = deque(input())

ans = 'No'
for _ in range(len(S)):
    S.appendleft(S.pop())
    if S == T:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

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

main()

Submission status: Accepted

Solution code:
S=list(input())
T=list(input())
x=len(S)
y=0
for i in range(x):
  S.append(S[0])
  del S[0]
  if S==T:
    y=1
  else:
    pass
  
if y==1:
  print("Yes")
else:
  print('No')

Submission status: Accepted

Solution code:
a=input()
b=input()
print("NYoe s"[b in a*2 ::2])

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
import sys
S = input()
T = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import deque

d = deque(input())
w = input()
ac = False
for i in range(len(d)):
  word = ""
  a = d.pop()
  d.appendleft(a)
  word = "".join(d)
  if word == w:
    ac = True
    break
if ac:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = list(input())
t = input()
for i in range(len(s)) :
        s.append(s[0])
        s.remove(s[0])
        if ''.join(s) == t :
                print('Yes')
                exit()
print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

SS = S + S

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [str(x) for x in input()]
t = [str(x) for x in input()]

def solve(s_list,t_list,n):
    if n== 120:
        return print("No")
    a = s_list.pop(-1)
    s_list.insert(0,a)
    if s_list ==t_list:
        return print("Yes")
    else:
        solve(s,t,n+1)

solve(s,t,0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np

def main():
	S = list(input())
	T = list(input())
	
	for i in range(len(S)):
		tmp = S.pop(-1)
		S.insert(0, tmp)
		if S == T:
			print("Yes")
			sys.exit()
		
	print("No")
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

dic = True if S==T else False
cnt = 1

while not dic and cnt <= len(S):
    ss = S[-cnt:] + S[:-cnt]
    if ss == T:
        dic = True
    cnt += 1

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
flag = False
for i in range(len(s)+1):
  s1 = s.pop(0)
  s.append(s1)
  if s==t:
    flag = True
    
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s1=list(input())
s2=list(input())
f=0
for i in range(len(s1)+1):
    if s1==s2:
        f+=1
    a=s1.pop(0)
    s1.append(a)
if f>0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = str(input())
T = str(input())

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

Submission status: Accepted

Solution code:
S = input()
T = input()
ans = 'No'

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = [""]*len(s)

for i in range(len(s)):
    for j in range(len(s)):
        x[j] = s[j-i-1]
    y="".join(x)
    if t in y:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
a= input()
b=input()
ok="No"
for i in range(len(a)):
  if b==a[i:] + a[:i]:
    ok="Yes"
print(ok)

Submission status: Accepted

Solution code:
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == S1[i:] + S1[:i]:
    ok = "Yes"
print(ok)

Submission status: Accepted

Solution code:
# 入力
S=input()
T=input()

for i in range(len(S)):
  # 回転
  S=S[-1]+S[:-1]

  # 一致する場合
  if S==T:
    print('Yes')
    exit()

# 最後まで一致しなければ'No'
print('No')

Submission status: Accepted

Solution code:
s, t = input(), input()
ls = len(s)

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