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

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

fl = False
for i in range(len(S)):
    S = rotate(S)
    if S == T:
        fl = True
print('Yes') if fl else print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

A = []
for i in range(len(s1)):
    a = s1[:i]
    b = s1[i:]
    A.append(b+a)

if s2 in A:
    print("Yes")
else:
    print("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[:-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")
    break
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[:-1]
    else:
        print("Yes")
        exit(0)
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 15分.
# アルゴリズムの理解に間違いがあり余計な時間を撮ってしまった

a = list(input())
b = list(input())
for i in range(len(a)):
    a.insert(0, a.pop(-1))
    if a == b:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
a = list(input())
b = list(input())
#print(a)
#print(b)
for i in range(len(a)):
    a.insert(0, a.pop(-1))
    #print(a)
    if a == b:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

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

flag = False
for i in range(len(S)):
    if S == T:
        flag = True
        break
    s = S.pop(-1)
    S.insert(0, s)
    
if flag:
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
l = len(s)
cnt=0
for x in range(l):
    if s == t:
        print('Yes')
        break
    else:
        cnt+=1
        s.insert(0, s[-1])
        s=s[:len(s)-1]
if cnt == l:
    print('No')

Submission status: Accepted

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


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

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

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:
S = input()
T = input()

for i in range(len(S)):
    k = []
    for j in range(len(S)):
        if j == 0:
            k.append(S[-1])
            continue
        k.append(S[j - 1])
    S = k
    if "".join(S) == T:
        print("Yes")
        exit()
print("No")

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:
s,t=str(input()),str(input())
if s==t:
  print("Yes")
  exit()
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 = 0
for i in range(len(S)):
  S = S[-1] + S[:-1] 
  if S == T:
    X = 1

if X == 0:
  print('No')
elif X == 1:
  print('Yes')

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

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

print('No')

Submission status: Accepted

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

for i in range(n):
    if s[n - i:n:] + s[:n - i:] == t:
        print('Yes')
        exit()
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(0)
print("No")

Submission status: Accepted

Solution code:
S = input()
T = input()
T += T
# modで考えていく

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

Submission status: Accepted

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

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

for i in range(length):
    if rolling(s, i) == t:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
Ss=input()
Ts=input()
s=[_ for _ in Ss]
t=[_ for _ in Ts]
l=len(Ss)
for i in range(l):
  temp=s[l-1]
  for j in range(l-1,-1,-1):
    s[j]=s[j-1]
  else:
    s[0]=temp
  if s==t:
    res='Yes'
    break
else:
  res='No'
print(res)

Submission status: Accepted

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

flag = False
for i in range(len(S)):
    s = ""
    for j in range(len(S)):
        a = (i+j)%len(S)
        s = s+S[a]
    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)):
    s = S[i:] + S[:i]
    if s == T:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

flag=False

for i in range(len(s)):
    buf=s[-1]
    s.insert(0,buf)
    del s[-1]
    if "".join(s) == t:
        flag=True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
T=input()
st=S
c=""
buf=""
flag=0
for i in range(len(S)):
    buf=st[:len(st)-1]
    c=st[len(st)-1]
    st="".join((c,buf))
    if (st==T):
        flag=1
        break

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

Submission status: Accepted

Solution code:
s, t = input(), input()
 
cnt = 0
while cnt <= len(s):
    s = s[-1] + s[:-1]
    if s == t:
        print("Yes")
        exit()
    cnt+=1
print("No")

Submission status: Accepted

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

_s = input()
_t = input()
print(solve(_s, _t))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
t = input()
flag = 0
for i in range(len(s)):
    s = s[1:]+s[0]
    #print(s)
    if t == s:
        flag = 1
print("Yes" if flag else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
T = readline().decode('utf8').rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
for i in range(len(s)):
  check = True
  for j in range(len(s)):
    if t[j] != s[(i+j)%len(s)]:
      check = False
  if check:
    print("Yes")
    exit()
      
print("No")

Submission status: Accepted

Solution code:
import sys
s=input()
t=input()
lists=list(s)
for _ in range(len(s)+1):
    s_top=lists.pop(0)
    lists.append(s_top)
    if(t==''.join(lists)):
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

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

for i in range(len(s), 0, -1):
    if s == tt[i:i+len(s)]:
        print('Yes')
        break
else:
    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:
s = input()
t = input()
flag = True

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

if flag:
    print('No')

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

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


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

print('No')

Submission status: Accepted

Solution code:
import sys

s = str(input())
t = str(input())


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

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
    else:
        s = s[-1] + s[0: len(s) - 1]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

m = ""
for i in range(len(s) + 1):

	y = s[i:] + s[:i]
	if t == y:
		print("Yes")
		exit()

print("No")

Submission status: Accepted

Solution code:
import sys

S = input()
T = input()

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

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = (list(input()) for _ in range(2))
for i in range(len(a)+1):
    if a == b:
        print("Yes")
        exit(0)
    a.insert(0,a.pop())
print("No")

Submission status: Accepted

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

if sorted(s) != sorted(t):
  print("No")
  exit(0)
else:
  for i in range(len(s)+1):
    if s == t:
      print("Yes")
      exit(0) 
    
    s.insert(0,s.pop())

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
S=[i for i in input()]
T=[i for i in input()]
N=len(S)
flg=0
for i in range(N):
    if S==T:
        print('Yes')
        flg=1
        break
    else:
        S.insert(0,S[N-1])
        del S[N]
if flg==0:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
T=list(input())
def shift(l):
  return l[1:]+l[:1]
for i in range(len(S)):
  S=shift(S)
  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: len(s)] + s[:i] == t):
    print('Yes')
    exit(0)
print('No')

Submission status: Accepted

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

rev_S = S
for s in S[::-1]:
  rev_S = s + rev_S[:-1]
  if rev_S == T:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
for i in range(len(s)):
    r = s[0]
    for j in range(len(s) - 1):
        s[j] = s[j + 1]
    s[j + 1] = r
    if (''.join(s) == ''.join(t)):
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S=input();T=input()
print("YNeos"[all(S[i:]+S[:i]!=T for i in range(len(S)))::2])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(len(t)):
  if s == t:
    print("Yes")
    exit()
  hoge = s.pop()
  s.appendleft(hoge)
print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = list(input().strip())
T = input().strip()
flag = False
for _ in range(len(S)):
    tmp = "" + S[-1]
    for i in range(len(S)-1):
        tmp += S[i]
    if tmp == T:
        flag = True
        break
    S = list(tmp)
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:
from collections import deque
S = deque(input())
T = list(input())

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

Submission status: Accepted

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

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

print(ans)

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[i:]+s[:i]) == t:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'No'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])

for i in range(L):
    if St == Tr:
        ans = 'Yes'
        break
    else:
        St.insert(0,St[L-1])
        del St[L]

print(ans)

Submission status: Accepted

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

tl=[]

for i in range(len(s)):
    wk = ''
    x = i
    for _ in range(len(s)):

        if x == len(s):
            x -= len(s)

        wk += t[x]
        x += 1
        
    tl.append(wk)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
del S[-1]
del T[-1]
l = len(S)
ans = "No"
for i in range(l) :
    a = S[-1]
    del (S[-1])
    S.insert(0,a)
    if S == T :
        ans = "Yes"
        break
print(ans)

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:
# B
s = input()
t = input()
n = len(s)
flag = 'No'
for _ in range(n):
    s = s[-1] + s[:-1]
    if s == t:
        flag = 'Yes'
        break
print(flag)

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = False

for i in range(1, len(s)+1):
    s1 = s[:i]
    s2 = s[i:]
    if s2 + s1 == t:
        flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

Submission status: Accepted

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


S = list(sys.stdin.buffer.readline().decode().rstrip())
T = list(sys.stdin.buffer.readline().decode().rstrip())

S = np.array(S, dtype=str)
T = np.array(T, dtype=str)


ok=False
for _ in range(len(S)):
    S = np.roll(S, 1)
    ok |= np.all(S == T)
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if t in s:
    print('Yes')
else:
    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:

s = list(input())
t = list(input())
a = ""
status = 0

if s == t:
    print("Yes")
    status = 1
else:
    for i in range(len(s)):
        a = s.pop()
        s.insert(0,a)
        if s == t:
            print("Yes")
            status = 1
        else:
            pass

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
S = str(input())
T = str(input())

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

Submission status: Accepted

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

print('Yes' if flag == True else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s, t = sys.stdin.read().split()
s *= 2

def main():
    n = len(t)
    for i in range(n):
        if s[i:i+n] == t:
            return 'Yes'
    return 'No'
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

match='No'
for i in range(len(S)):
    end=S[-1]
    change = end + S[0:len(S)-1]
    if T == change:
        match='Yes'
    else:
        S=change

print(match)

Submission status: Accepted

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

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

else:
    for i in range(len(s)-1):
        lst =[]
        lst.append(s[i+1:])
        lst.append(s[:i+1])

        if ''.join(lst)==t:
            print('Yes')
            break

    else:
        print('No')

Submission status: Accepted

Solution code:
old_str = input()
compare_str = input()

old_str = [e for e in old_str]
flag = False
for i in range(len(old_str)):
    old_str.append(old_str.pop(0))
    if ''.join(old_str) == compare_str:
        flag = True
        break
if flag:
    print("Yes")
else:
    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[len(S)-1]+S[0:len(S)-1]


print("No")

Submission status: Accepted

Solution code:
from collections import deque

S = list(input())
T = list(input())
T_deque = deque(T)

S_deque = deque(S)
flag = 0
for i in range(len(S)):
    # print(S_deque)
    if S_deque == T_deque:
        flag = 1
        break
    else:
        S_deque.rotate()

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

Submission status: Accepted

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

for i in range(len(s)):
    h = s.pop()
    s = list(h) + s
    if s == t:
        ans = "Yes"
        break
else:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
flag = 0
for i in range(102):
    if s == t:
        flag = 1
        break
    p = s.pop(-1)
    s.insert(0,p)

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

Submission status: Accepted

Solution code:
S=input()
T=input()
s=[]
t=[]
for i in range(len(S)):
    s.append(S[i])
for i in range(len(T)):
    t.append(T[i])
flg=False
for i in range(len(S)):
    s=[s[-1]]+s[:-1]
    if s==t:
        flg=True
print("Yes" if flg else "No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = list(input().rstrip())
T = list(input().rstrip())
N = len(S)
for i in range(N):
    S = list(S[-1]) + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
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:
S = input()
T = input()


def rotate(S):
        tmp = S[-1]
        S = S[:-1]
        S = tmp + S
        return S

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

s = input()
t = input()

S = list(s)

isPossible = False
for i in range(len(S)):
    temp = s[i:] + s[:i]
    if temp == t:
        isPossible = True

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

Submission status: Accepted

Solution code:
S = list(input())
T = list(input())
n = len(S)
ans = 'No'
if len(S) == len(T):
    for i in range(n):
        if S == T:
            ans = 'Yes'
        else:
            tmp = T[0]
            T.remove(tmp)
            T.append(tmp)
            
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = "No"
for i in range(len(s)):
    s = s[-1] + s[0:len(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 == T[i:]+T[:i]:
    j = 1
    break
  else:
    j = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input();
t = input();
if str(s*2).count(t):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if S.find(input()) != -1:
 print('Yes')
else:
 print('No')

Submission status: Accepted

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

S += S

A = S.find(T)

if A != -1:
 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:
        ans=0
    else:
        ans=1
        break
if ans==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
#H, W=input().split()
S=input()
T=input()
S_list=list(S)
T_list=list(T)

for i in range(len(T)):
  T_list.append(T_list[i])

#print(S_list)
#print(T_list)

#H=int(H)
#W=int(W)
#C=int(C)
#K=int(K)
i=0
ID_list=[]
ID_sublist=[]
pixel_list=[]
H_dummy=0
W_dummy=0
C_dummy=0
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#pixel_list =  [list(input())for i in range(H)]
#for i in range(H):
#  ppixel_list=list(input())
#  
#print(pixel_list)
i=0
j=0
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる

#整数二次元配列を読み込む時のやり方
#gate_list =  [list(map(int, input().split(" ")))for i in range(M)]
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！

for i in range(len(T)):
    #print(i)
    for j in range(len(T)):
     if S_list[j]!=T_list[i+j]:
         break
     elif j==len(S)-1 :
         print("Yes")
         sys.exit()
print("No")

Submission status: Accepted

Solution code:
def rotate(string):
    return string[1:] + string[0]


S = input()
T = input()

s = S
for _ in range(len(S)):
    s = rotate(s)
    if s == T:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
T=input()
n=len(S)
S=S+S
if sum([1 if S[i:i+n]==T else 0 for i in range(n)])>0:
  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=list(input())
t=list(input())
for i in range(len(s)+1):
  if s == t:
    print("Yes")
    break
  else:
    k = s[0]
    for i in range(len(s)-1):
      s[i]=s[i+1]
    s[-1] = k
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
t=input()
n=len(s)
t+=t
for i in range(n):
    ans=True
    for j in range(n):
        if t[i+j]!=s[j]:
            ans=False
            break
    if ans:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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