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:
str1, str2 = input(), input()


def check(s1, s2):
    return s1 == s2


def move(s, i):
    n = len(s)
    temp = ""
    for j in range(n):
        temp += s[(j+i) % n]

    return temp


N = len(str1)

for i in range(N):
    temp = move(str1, i)
    if check(temp, str2):
        print("Yes")
        break
    if i == (N-1):
        print("No")

Submission status: Accepted

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

ss = s+s
num = len(s)
for i in range(len(s)):
    #print()
    if ss[i:i+num] == a:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'No'

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

print(ans)

Submission status: Accepted

Solution code:
import copy
import sys

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

A = copy.deepcopy(S)
B = A.pop()
A.insert(0, B)

b = False

if S == T:
    print('Yes')
    b = True
    
while A != S:
    if A == T:
        print('Yes')
        b = True
    B = A.pop()
    A.insert(0, B)

if not b:
    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:
def solve():
    S = input()
    T = input()
    N = len(S)
    ret = False
    for i in range(N):
        if T == S[i:]+S[:i]:
            ret = True
            break
            
    print('Yes' if ret else 'No')
    
solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S, T = list(input()), list(input())
# print(S, T)


def create_new_T(_old_T):
  _newT = []
  for i in range(0, len(_old_T)):
    if i == 0:
      _newT.append(T[len(T) - 1])
    else:
      _newT.append(T[i - 1])
  return _newT

count = 0

for i in range(0, len(T)):
  T = create_new_T(T)
  if T == S:
    count += 1

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

Submission status: Accepted

Solution code:
def examB():
    S = SI(); T = SI()
    ans = "No"
    for i in range(len(S)):
        flag = True
        for j in range(len(S)):
            if S[j-i]!=T[j]:
                flag = False
        if flag:
            ans = "Yes"
            break
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

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

Submission status: Accepted

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

sl = list(s)
tl = list(t)
sl.sort()
tl.sort()

if sl != tl:
    print('No')
    quit()

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

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:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1

s=collections.deque(input())
t=input()
for i in range(len(s)):
    s.rotate(1)
    if "".join(s)==t:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
from collections import deque

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

ans = 'No'
for i in range(len(s)):
    s.appendleft(s.pop())
    if t == s:
        ans = 'Yes'
        break
        
print(ans)

Submission status: Accepted

Solution code:
s = str(input())
t = str(input())
flg = 0
for i in range(len(s)):
    if s == t:
        flg = 1
        break
    s = s[-1] + s[:len(s)-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
I = input()
B = 0
I_count = len(I)
G = input()
for i in range(I_count):
    if G == I:
        print("Yes")
        exit()
    B = I[-1]
    I = I[:-1]
    I = B + I
print("No")

Submission status: Accepted

Solution code:
from collections import deque

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

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

    else:
        tmp = S[-1]
        S.pop()
        S.appendleft(tmp)

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

t = input()
t = list(t)

ans = 0
temp = ''

for i in range(len(s)):
	if s == t :
		ans = 1
	else:
		temp = t[0]
		for j in range(len(s)):
			if j == len(s)-1:
				t[j] = temp
				#print(j,t[j],temp)
			else:
				t[j] = t[j+1]
		#print(t)

print('Yes' if ans==1 else 'No')

Submission status: Accepted

Solution code:
S = input()
T = input()
if S == T:
    print("Yes")
    exit()
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()
tmp_str=[]
flag=False
for i in range(len(S)-1):
    if S==T:
        flag=True
        break;
    
    tmp=list(S)
    tmp_char=tmp.pop()
    tmp.insert(0,tmp_char)
    
    S=''.join(tmp)
    if S==T:
        flag=True
        break;

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False # 一致するかどうかを示すフラグ

for i in range(len(S)):
    Sr=np.roll(S,i) # ロールさせる
    
    if (Sr==T).all(): # 一致する場合、フラグを立てて終了
        OKflag=True
        break

if OKflag==True: # 回転させて一致するなら
    print("Yes")
else: # 一致しないなら
    print("No")

Submission status: Accepted

Solution code:
S=input()
T=input()
r='No'
for i,_ in enumerate(S):
    if S[i:]+S[:i] == T:
        r='Yes'
        break
print(r)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str, T: str):
    if T in (S + S):
        print(YES)
    else:
        print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    solve(S, T)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
T = list(input())
if S == T:
  ans = "Yes"
else:
  for i in range(len(S) - 1):
    S.insert(0, S[-1])
    S.pop(-1)
    if S == T:
      ans = "Yes"
      break
    else:
      ans = "No"

print(ans)

Submission status: Accepted

Solution code:
A = input()
B = input()
t = False
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
t = input()
len_str = len(s)
for i in range(len_str)[::-1]:
  temp = s[i:] + s[:i]
  if t == temp:
    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=list(input())
t=list(input())

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

Submission status: Accepted

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

S = []
T = []

for i in s:
    S.append(i)
for j in t:
    T.append(j)

ans = 'No'

for n in range(len(S)):
    last = S[-1]
    del S[-1]
    S.insert(0, last)
    if S == T:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

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

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

Submission status: Accepted

Solution code:
flag=0
s,t=(input(),input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(len(s)+1):
    s.append(s.pop(0))
    if s == t:
        print("Yes")
        sys.exit()
    
print("No")

Submission status: Accepted

Solution code:
S = list(input()*2)
T = list(input())
ans = 'No'
for i in range(len(S)//2):
    check = 1
    for j in range(len(S)//2):
        if S[i+j] != T[j]:
            check = 0
    if check == 1:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

Solution code:
import copy

S = list(input())
T = list(input())
Stmp = copy.copy(S)

if S == T:
    print("Yes")
else:
    flg = False
    s = S.pop(-1)
    S.insert(0, s)
    if S == T:
        flg = True

    while Stmp != S:
        s = S.pop(-1)
        S.insert(0, s)
        if S == T:
            flg = True
            break

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

Submission status: Accepted

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

lis = S[:]
for _ in S:
  s = lis.pop(-1)
  lis.insert(0, s)
  if lis == T:
    print('Yes')
    break
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for idx in range(len(s)):
    rotated_s=s[idx:]+s[0:idx]
    
    if (rotated_s == t):
        print('Yes')
        exit(0)

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 103: B – String Rotation
s, t = [input() for _ in range(2)]

is_equal = 'No'

if s == t:
    is_equal = 'Yes'
else:
    for i in range(len(s)):
        s = s[-1] + s[:-1]
        if s == t:
            is_equal = 'Yes'
            break

print(is_equal)

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()
t = stdin.readline().rstrip()

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
T = input() * 2
for i in range(len(S)):
    for j in range(len(S)):
        s, e = [i+j, i+j+len(S)]
        if (T[s:e] == S):
            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:
S = input()
T = input()
leng = len(S)
ans = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
S = input()
T = input()

# solve
ans = False
for i in range(len(S)):
    S = S[len(S) - 1] + S[0:len(S) - 1]
    if S == T:
        ans = True
        break

# output
print('Yes' if ans else 'No')

Submission status: Accepted

Solution code:
def main(s, t):
    for i in range(len(s)):
        if (s[i:] + s[:i]) == t:
            print('Yes')
            return

    print('No')


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

    main(s, t)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=list(input())
t=list(input())
ans='No'
for i in range(len(s)):
    tmp=s[len(s)-1]
    s.pop(len(s)-1)
    s.insert(0,tmp)
    if s==t:
        ans='Yes'
        break
print(ans)

Submission status: Accepted

Solution code:
a=input()
b=input()
al=list(a)
bl=list(b)
for i in range(len(al)):
    al.append(al[0])
    al.remove(al[0])
    if al==bl:
        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 = list(input())
T = str(input())

check = 'No'

for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(0, A.pop(-1))

print(check)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
S = list(input())
T = list(input())

for i in range(len(S)):
    if S == T:
        print("Yes")
        exit()
    S.insert(0, S.pop(-1))
print("No")

Submission status: Accepted

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

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

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[0]
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = input()
tmps = s[-1] + s[:-1]
if tmps == t:
	print ("Yes")
	exit()
while tmps != s:
	tmps = tmps[-1] + tmps[:-1]
	if tmps == t:
		print ("Yes")
		exit()
print("No")

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-08 15:54:47(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   # if use comb function on AtCoder, 
# import scipy.misc      # select scipy.misc.comb (old version)  


def stringRotation(s):
    # |s| must be more than 1
    return s[-1] + s[:-1]


def main():
    s, t = sys.stdin.read().split()
    for _ in range(len(s)):
        if s == t:
            ans = 'Yes'
            break
        s = stringRotation(s)
    else:
        ans = 'No'
    
    print(ans)



if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

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

Submission status: Accepted

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

flg = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

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

Submission status: Accepted

Solution code:
print("Yes" if (input()*2).count(input()) > 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = list(input())
T = list(input())
ans = "No"
for i in range(len(S)):
    tmp = S.pop(-1)
    S.insert(0,tmp)
    if S == T:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()
t=input()
for i in range(len(s)):
    tmp=s[i:]+s[:i]
    if tmp==t:
        print("Yes")
        quit()
print("No")

Submission status: Accepted

Solution code:
def rotate(i):
  return S[i+1:] + S[:i+1]

S = input()
T = input()

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

print("No")

Submission status: Accepted

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


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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
ch_list = []
n = len(s)
flag = 0
ch_list = ["" for i in range(n)]
for i in range(n):
    for j in range(n):
        ch_list[(j+i)%n] = s[j]
    if ch_list == t:
        flag = 1
if flag == 1: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
s = list(input())
t = list(input()) 
for _ in range(len(s)):
  s.insert(0, s[-1])
  s.pop()
  if s==t:
    print('Yes')
    quit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
T=list(input())
def shift(l, n):
  return l[n:] + l[:n]
N=len(S)
for i in range(N):
  if shift(S,i)==T:
    print("Yes")
    break
  else:
    pass
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(S)
#print(T)
for i in range(len(S)):
    check_str = "".join(S[i:len(S)] + S[0:i])
    #print(check_str)
    if check_str == T:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    S = input()
    T = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

def rotate(word):
    last=word[-1]
    word=word[:-1]
    word=last+word
    return(word)

flag=0
for i in range(N):
    if S==T:
        flag=1
        break
    else:
        S=rotate(S)

print(['No','Yes'][flag])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

S += S

answer = 'Yes' if S.find(T) != -1 else 'No'
print(answer)

Submission status: Accepted

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

for i in range(len(S)):
    check_str = "".join(S[i:len(S)] + S[0:i])
    #print(check_str)
    if check_str == T:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

for i in range (1,N+1):
  S1 = S
  x = S1[N-1-(i-1):N]
  S2 = x + S1
  S2 = S2[:-i]
  if S2 == T:
    print("Yes")
    sys.exit()
print("No")

Submission status: Accepted

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

i = 0
while i <= len(s):
    s = s[1:] + s[0]
    i += 1
    if s == t:
        print("Yes")
        quit()

print("No")

Submission status: Accepted

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

if T in S * 2:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
#103b
S = str(input())
T = str(input())
T = T + T

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

Submission status: Accepted

Solution code:
#2019/10/15
S, T = open(0).read().split()
print("Yes" if T in S+S else "No")

Submission status: Accepted

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

ans = "No"

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

flag = False
tmp = []
for i in range(len(s)):
    if s == t:
        flag = True
        break
    tmp = s[1:]
    tmp.append(s[0])
    s = tmp

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque

s = deque(input())
T = input()

for _ in range(len(s)):
    s.rotate(1)
    tmp = "".join(s)
    if tmp == T:
        print("Yes")
        exit()

print("No")

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')
        break
if s != t:
    print('No')

Submission status: Accepted

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

s = list(S)
ans = 0

if S.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    #print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(s,t):
    if(s == t):
        return "Yes"
    for i in range(len(s)-1,0,-1):
        f = s[i:] + s[:i]
        if(f == t):
            return "Yes"
    return "No"

s = input()
t = input()
print(solve(s,t))