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:
def main(string1, string2):
	
	answer = "No"
	
	for i in range(len(string1)):
		
		newstring = string2[i:] + string2[:i]
		
		if string1 == newstring:
			
			answer = "Yes"
	
	return answer
	
	
string1 = input()
string2 = input()

print(main(string1, string2))

Submission status: Accepted

Solution code:
s=list(input())
t=list(input())
n=len(s)
a=0
for i in range(n):
    k=s[0]
    del s[0]
    s.append(k)
    if s==t:
        a+=1
        print("Yes")
        break
if a==0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rot(s):
    tmp = s[0]
    s = s[1:]
    s += tmp

    return s


s1 = input()
s2 = input()

for i in range(len(s1)):
    if s1 == s2:
        print("Yes")
        exit(0)

    s2 = rot(s2)

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

condition=0
x=len(S)

for i in range(x):
    if S[i:]+S[:i]==T:
        condition=1
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


S=input()
T=input()
le=len(S)
s=[]
t=[]
sr=[]
for i in range(le):
  s.append(S[i])
  t.append(T[i])
  sr.append(S[i])

def rotate():
  for j in range(le):

    for i in range(le):
      sr[i]=s[(i+j)%le]
    if sr==t :
      return("Yes")
  return("No")

print(rotate())

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:
S=input()
T=input()
for i in range(len(S)):
    if S[i:]+S[:i]==T:
        print("Yes")
        quit()
    else:
        pass
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = False

for i in range(len(s1)):
    next_word =s1[i:] + s1[:i]

    if s2 == next_word:
        flag = True


if flag:
    print("Yes")
else:
    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")
        break

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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:-1]
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s = input()
t = input()
temp = list(s)
flag = 0
for i in range(len(s)):
    # test = str(temp.insert(0,temp.pop()))
    test = temp.pop()
    temp.insert(0,test)
    test = "".join(temp)
    # print(i,test)
    if test == t:
        print("Yes")
        flag = 1
        break
if not flag:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

    temp = s[:]

    if (len(s) != len(t)):
        print('No')
        return

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

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

S = input()  # 回転する方
T = input()

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

Submission status: Accepted

Solution code:
string1 = input()
string2 = input()

flag = False
for _ in range(len(string1)):
    if string1 == string2:
        flag = True
        break
    string1 = string1[-1] + string1[:-1]
    
if flag == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(str(input()))
t = list(str(input()))
flag = 0
for i in range(len(s)):
    sippo = s[-1]
    del s[-1]
    s.insert(0,sippo)
    #print(s)
    if s == t:
        flag = 1
        break
    else:
        continue
        
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'No'
if s == t:
    ans = 'Yes'

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

Submission status: Accepted

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

flag = False
for i in range(0, len(s)):
    if s[i:] + s[:i] == t:
        flag = True
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

s=input()
t=input()

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

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    S = stdin.readline().rstrip()
    T = stdin.readline().rstrip()
    for _ in range(len(T)):
        T = T[-1] + T[:-1]
        if S == T:
            print('Yes')
            break
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

aa = len(a)
bb = len(b)
c = 0

def co(pp,qq,p):
	for i in range(p):
		if pp[i] != qq[i]:
			return 0
	return 1 

if aa != bb:
	print("No")

else:
	for i in range(aa):
		k = a[-1]
		a = a[:aa-1]
		a.insert(0,k)
		if c == 0:
			c = co(a,b,aa)


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

Submission status: Accepted

Solution code:
import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
a=input()
b=input()
dumy=""
count=True
for i in range(len(a)):
  if(a==b):
    print("Yes")
    count=False
    break
  a=list(a)
  dumy=a.pop()
  a="".join(a)
  a=dumy+a
if(count==True):
  print("No")

Submission status: Accepted

Solution code:
a = list(input())
b = list(input())
i = 0
while True:
    c = b[-1]
    b = b[:-1]
    b = [c] + b
    if a == b:
        yesno = 'Yes'
        break
    i += 1
    if i > len(a)+1:
        yesno = 'No'
        break

print(yesno)

Submission status: Accepted

Solution code:
string_a = input()
string_b = input()
isCorrespond = False
for n in range(len(string_b)):
    tmp = string_a[0]
    string_a = string_a[1:].strip() + tmp
    if(string_a == string_b):
        isCorrespond = True
        break

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

Submission status: Accepted

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

l=len(S)

for i in range(l):
	if S[i:]+S[:i]==T:
		print "Yes"
		quit()
else:
	print "No"

Submission status: Accepted

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

Submission status: Accepted

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

S = []
for i in range(len(s)):
    S.append(s[i:] + s[:i])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

s = input()
t = input()

ans = 'No'
if s == t: ans = 'Yes'

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

print(ans)

Submission status: Accepted

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

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

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

    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
T = list(input())
key = T[0]
flag = False
k = 0

for i in range(len(S)):
	if S[i] == key:
		k = i
		flag = True
		break

if not flag:
	print("No")
	exit()

for i in range(len(S)):
	if not T[i] == S[(k + i) % len(S)]:
		flag = False
		break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_s = input()
str_t = input()

for i in str_s:
    str_s = str_s[-1] + str_s[0:-1]
    if str_s == str_t:
        print("Yes")
        exit(0)
print("No")

Submission status: Accepted

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

s = input()
t = input()

string = s
res = False
for i in range(len(s)):
    x = i * -1
    string =  s[x:] + s[:x]
    if string == t:
        res = True
        break

if res == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

    def rot(s, n):
        return s[n:] + s[:n]

    for i in range(0, len(s)):
        v = rot(s, i)
        if v == t:
            print('Yes')
            return

    print('No')
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=list(input())
b=list(input())
for i in range(len(b)):
    if a==b:
        break
    else:
        tmp=a[0]
        del a[0]
        a.append(tmp)
    #print(a)
if a==b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

slen = len(S)

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

Submission status: Accepted

Solution code:
S = input()
T = input()
flag = False
tmp_S = S

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

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

Submission status: Accepted

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

l = len(S)
j = 0

for i in range(l):
    s_ = S[i:] + S[:i]
    if T == s_:
        j = 1
        break

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

Submission status: Accepted

Solution code:
def rotate(st):
    x = st[-1]
    return x + st[:-1]

S = input()
T = input()

flag = False

for i in range(len(S)):
    if S == T:
        flag = True
        break
    S = rotate(S)

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

if __name__ == '__main__':
	s, t = input(), input()
	print(check(s,t))

Submission status: Accepted

Solution code:
# coding=utf-8


def string_rotate(string):
    return_string = string[:]
    return return_string[-1:] + return_string[:-1]


if __name__ == '__main__':
    S = input()
    T = input()

    if S == T:
        print('Yes')
    else:
        S_copy = S[:]
        S_copy = string_rotate(S_copy)

        for i in S:
            if S_copy == T:
                print('Yes')
                break
            S_copy = string_rotate(S_copy)
        else:
            print('No')

Submission status: Accepted

Solution code:
s = input()
t = input()
flag = False
for i in range(len(s)):
    q = s[i:] + s[:i]
    if q == 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==t[i:]+t[:i]:print("Yes");exit()
print("No")

Submission status: Accepted

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

ff = False
for i in range(len(s)):
    f = True
    for j in range(len(s)):
        if s[j] != t[i+j]:
            f = False
            break
    if not f:
        continue
    print('Yes')
    ff = True
    break
if not ff:
    print('No')

Submission status: Accepted

Solution code:
import sys

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

for i in range(len(S)):
    temp = S.pop(-1)
    S.insert(0, temp)

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

print("No")

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
T = input()
s = []
t = []
for i in range(len(S)):
    s.append(S[i])
    t.append(T[i])

key2 = 0

for i in range(len(S)):
    if t[0] == s[i]:
        key = i
        s_key = s[i::] + s[0:i]
        for j in range(len(S)):
            if s_key == t:
                key2 = 1
                break

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

Submission status: Accepted

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

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

if ans == "":
  ans = "No"

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

S = input()
T = input()

def rotate(s):
    return s[-1] + s[:-1]

ans = "No"

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input()
t = raw_input()
print "Yes" if s in t+t else "No"

Submission status: Accepted

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

def determin():
    for i in range(len(S)):
        if S[i:]+S[:i]==T:
            return "Yes"
    return "No"
print(determin())

Submission status: Accepted

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

def rotate(l, n):
    return l[n:] + l[:n]

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
s = input()
t = input()
n = len(s)
ans = 'No'
for i in range(n):
    a = ''
    for k in range(n):
        l = k + i
        if l >= n: l = l - n
        a += s[l]
    if a == t:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

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

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()
s = s*2
try:
    s.index(t)
    print('Yes')
except:
    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()
f = 0
i = 0
while i < len(s):
    s0 = s[-i:]+s[:-i]
    if s0 == t:
        f = 1
        break
    i += 1
if f == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
flag = 0
for i in range(len(s)):
    if s == t:
        print("Yes")
        flag = 1
        break
    a = s.pop(0)
    s.append(a)
if flag == 0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

flg_possible = False 

for i in range(len(S)) :
    s1 = S[0:i]
    s2 = S[i:len(S)]
    
    if s2 + s1 == T :
        flg_possible = True
        break
        
if flg_possible == True :
    print("Yes")
else :
    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')
        exit()
print('No')

Submission status: Accepted

Solution code:
from numpy import *
from scipy import *
from sys import *
from collections import *

s = input()
t = input()

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = raw_input()
b = raw_input()
print 'Yes' if any(a[i:] + a[:i] == b for i in xrange(len(a))) else 'No'

Submission status: Accepted

Solution code:
S = input()
T = input()
N = len(T)
for i in range(N):
    f = True
    for d in range(N):
        p = (i + d) % N

        if S[d] != T[p]:
            f = False
            break
    if f:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

def Rotate(s):
    return s[-1] + s[:-1]

for _ in range(len(S)):
    if S == T:
        print('Yes')
        exit()
    S = Rotate(S)

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

S += S
if S.find(T) == -1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

for _ 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()
x=[s]
for i in range(len(s)-1):
    x.append(x[-1][-1]+x[-1][0:-1:])
print('Yes' if t in x else 'No')

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
ss = input().strip()
ts = input().strip()

ss = ss + ss + ss

if ss.find(ts) != -1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a = input()
b = input()
l = len(a)
aa = []
for i in range(l):
    aa.append(a[-1] + a[:-1])
for i in range(l):
    b = b[-1] + b[:-1]
    for j in aa:
        if b==j:
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def kit(x):
  return x[len(x)-1]+x[:len(x)-1]

a=input()
b=input()

for i in range(len(a)):
  a=kit(a)
  if a==b:
    print('Yes')
    exit()
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = 0

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

Submission status: Accepted

Solution code:
import sys
S=input()
T=input()
N=len(S)
if S==T:
    print('Yes')
    sys.exit()
for i in range(1,N):
    a=S[-i:]+S[:N-i]
    #print(a)
    if a==T:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
#coding:utf-8

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

def rot(string):
    string = string[n-1] + string[:n-1]
    return string

for i in range(n):
    if s == t:
        print("Yes")
        break
    s = rot(s)
else:
    print("No")

Submission status: Accepted

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

count=0

if s==t:
  count=1

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

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

Submission status: Accepted

Solution code:
def solve(s, t):
    ss = {s[i:] + s[:i] for i in range(len(s))}
    return "Yes" if t in ss else "No"

if __name__ == "__main__":
    s = input()
    t = input()
    print(solve(s, t))

Submission status: Accepted

Solution code:
import sys
S = input()
T = input()
if S == T:
  print('Yes')
  sys.exit()
i = 0
while i < 100:
  x = S[-1]
  S = x+S
  S = S[:-1]
  if S==T:
    print('Yes')
    sys.exit()
  else:
    i += 1
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
ans = "No"
for i in range(0,len(s)):
    a = s.pop(0)
    s.append(a)
    if s == t:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S, T = input(), input()
def f():
    for i in range(len(S)):
        if T == S[i:] + S[:i]:
            print("Yes")
            return
    print("No")
f()

Submission status: Accepted

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

Submission status: Accepted

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

flag = True
for _ in range(len(t)):
  if s == t:
    print('Yes')
    flag = False
    break
  s = s[-1] + s[:-1]

if flag:
  print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
T = input()
ans = 'No'
M = len(S)
if len(S) != len(T):
    pass
else:
    for i in range(M):
        SK = ''
        for j in range(M):
            SK += S[(j+i)%M]
        if T == SK:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


S=input()
T=input()

kaitensu=len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

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


print(ans)

Submission status: Accepted

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

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

print(Ans)

Submission status: Accepted

Solution code:
import sys
S = sys.stdin.readline().strip()
T = sys.stdin.readline().strip()
flag = False
for i in range(len(S)):
    if S == T[i:] + T[:i]:
        flag = True
        break
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
s = input()
t = input()
for _ 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)):
    if S[i:] + S[:i] == 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")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
s1=input()
s2=input()
f = False
for i in range(len(s1)):
  if s1==s2:
    f = True
    break
  else:
    s1=s1[-1]+s1[:-1]
if f:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
s = raw_input()

t = raw_input()


l = len(s)
for i in range(l):

	if s[i:] + s[:i] == t:
		print 'Yes'
		sys.exit()

print 'No'

Submission status: Accepted

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

c = 0
for i in range(len(s)):
  if s[i:] + s[:i] ==t:
    print("Yes")
    c = 1
    break
if c==0:
  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 = input()
t = input()

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

Submission status: Accepted

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

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