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:
a, b = input(), input()
a *= 2
print('Yes' if b in a else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import deque
s=list(input())
s=deque(s)
t=input()
for i in range(len(s)):
  if ''.join(s)==t:
    print("Yes")
    exit()
  s.append(s.popleft())
print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from sys import stdin
s = list(stdin.readline().rstrip())
t = list(stdin.readline().rstrip())
for i in range(len(s)):
    s=list(s[-1])+s[:len(s)-1]
    if s==t:
        print('Yes')
        sys.exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()
b=input()
a=a+a
print("Yes" if b in a else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
T = input()
listS = list(S)
listT = list(T)
for i in S:
 #   print(listS,listT)
    if listS == listT:
        print("Yes")
        exit()
    else:
        hoge = listS.pop(0)
        listS.append(hoge)
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(str(input()))
t = list(str(input()))
res = "No"
for i in range(len(s)) :
  s.append(s[0])
  s.pop(0)
  if(s == t) : res = "Yes"
print(res)

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
s=list(input())
t=list(input())
flag=False
count=0
while count!=len(s):
    a=s[-1]
    del s[-1]
    s.insert(0,a)
    if s==t:
        flag=True
        break
    count+=1
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
t=str(input())
num=len(s)
p=0
if s==t:
    print('Yes')
else:
    for i in range(1,num,1):
        a=s[-i:]
        b=s[:num-i]
        c=a+b
        if c==t:
            print('Yes')
            break
        else:
            p+=1
if p==num-1:
    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:
s = input()
t = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
while count <= len(S):
    if S == T:
        print('Yes')
        exit()

    tmp = S.pop(0)
    S.append(tmp)
    count += 1
print('No')

Submission status: Accepted

Solution code:
S=input()
T=input()
S1=list(S)
ans='No'
def f(S1,i):
    return S1[i:]+S1[:i]
for j in range(-1,len(S)-1):
    S2=''.join(f(S1,j))
    if S2==T:
        ans='Yes'
print(ans)

Submission status: Accepted

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

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

print(f())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = list(input())
T = list(input())
new_S = S
judge = 0

if(S == T):
  print('Yes')
else:
 for i in range(len(S)):
  tmp = S.pop(-1)
  S.insert(0,tmp)
  new_S = S
  if(new_S == T):
    judge = 1
    break
 if(judge == 1):
  print('Yes')
 else:
  print('No')

Submission status: Accepted

Solution code:
#ABC103 B
#S,Tが次をみたすかどうか判定せよ
#Sの末尾の文字をSの先頭に移動させる操作を有限回繰り返すと,Tに一致する
#
#Sを2回繰り返した文字列からSと同じ長さの任意の区間を切り取ってTに一致させられればよい

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

def rotatable(s, t):
    for i in range(len(s)):
        s = s[-1] + s[0:-1]
        if s == t:
            return True
    return False

if rotatable(S, T):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
T = input()
flg = False
for i in range(len(T)):
  if S == T:
    flg = True
    break
  T = T[-1] + T[:-1]
print(['No', 'Yes'][flg])

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]
    if S == T:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
def string_rotation(S: str, T: str)->bool:
    for i in range(len(S)):
        if S[i:] + S[:i] == T:
            return True
    return False


if __name__ == "__main__":
    S = input()
    T = input()
    yes = string_rotation(S, T)
    print('Yes' if yes else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys 


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


def solve(s,t):
  for i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
      return True
  return False

if solve(s,t):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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"
print(ans)

Submission status: Accepted

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

for i in range(len(s)):
    s.append(s.pop(0))
    if s == t:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
def solve():
    S=input()
    T=input()
    l=len(S)
    for i in range(l):
        if T == S[i:] + S[:i]:
            return True
    return False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
t=input()
def C(i):
        if all(s[(i+j)%len(s)]==t[j] for j in range(len(s))):
                return True
if any(C(i) for i in range(len(s))):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

answer = 'No'

if S == T:
    answer = 'Yes'

for x in range(0,len(S)):
    S = S[-1] + S[0:-1]
    if S == T:
        answer = 'Yes'

print(answer)

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

count = 0
for i in range(len(S)):
    S.insert(0,S[-1])
    S.pop(-1)
    if S == T:
        count += 1
        break
   
if count == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''

if set(S)!=set(T):
    ans = 'No'

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

if not ans:
    ans = 'No'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

S2 = S + S

print("Yes" if T in S2 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(str(input()))
t=list(str(input()))
f=True
for i in range(len(s)):
    s.append(s[0])
    del s[0]
    if s==t:
        f=False
        break
    else:
        pass
print("YNeos"[f::2])

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc103/tasks/abc103_b
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:
S = input()
T = input()

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

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()
answer = "No"

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

print(answer)

Submission status: Accepted

Solution code:
s=input()
t=input()
count=0
while 1:
  if s==t:
    print("Yes")
    break
  if count==len(s):
    print("No")
    break
  s=s[1:]+s[0]
  count+=1

Submission status: Accepted

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


ans = "No"
for i in range(len(s)):
    tmp = ''
    for j in range(len(s)):
        if i+j < len(s):
            tmp += t[i+j]
        else:
            tmp += t[i+j-len(s)]
    if tmp == s:
        ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
first=list(input())
second=list(input())
first_s=set(first)
second_s=set(second)
lengh_f=len(first)
lengh=len(second)
a="No"
for i in range(lengh): 
    if first_s!=second_s or lengh_f!=lengh:
        break
    tmp=tuple(second)  #なぜタプルなのか?
    for j in range(lengh):
        if j==lengh-1:
            second[j]=tmp[0]
        else:
            second[j]=tmp[j+1]
    if first==second:
        a="Yes"
        break
print(a)

Submission status: Accepted

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

while i < n:
    s = s[-1] + s[:n-1]
    i += 1
    if s == t:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rotate(S):
	S_list = list(S)
	S_last = S[-1]
	S_list.pop(-1)
	S_list.insert(0,S_last)
	return ''.join(S_list)

S = input()
check = input()
for i in range(len(S)):
	S = rotate(S)
	if S == check:
		print('Yes')
		exit()

print('No')

Submission status: Accepted

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

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

for i in range(len(s)):
	if t == rot(s, i):
		print('Yes')
		exit()
print('No')

Submission status: Accepted

Solution code:
import collections as cc
A = cc.deque(input())
B = cc.deque(input())
for i in range(100):
    if A == B:
        print("Yes")
        exit()
    else:
        tmp = A.pop()
        A.appendleft(tmp)
print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def main():
    S, T = [input() for _ in range(2)]
    ans = "Yes" if S == T else "No"
    new_S = S
    for i in range(len(S)):
        new_S = new_S[-1] + new_S[:-1]
        if new_S == T:
            ans = "Yes"
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print('NYoe s'[input()in input()*2::2])

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc103/tasks/abc103_b

S = input()
T = input()

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

print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  S = str(input().strip())
  T = str(input().strip())
  ans = 'No'
  for _ in range(len(S)):
    if S == T:
      ans = 'Yes'
      break
    else:
      S = S[1:] + S[0]
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 11 05:38:56 2019

@author: shinjisu
"""


# ABC 200点問題
import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


debug = True


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def prob096():  # Maximum Sum
    X = getIntList()
    K = getInt()
    dmp((X, K))
    total = sum(X) - max(X) + max(X)*2**K
    return total


def prob097():  # Exponential
    X = getInt()
    dmp(X)
    if X == 1:
        return 1
    for n in range(X, 0, -1):
        dmp(n)
        for b in range(2, int(math.sqrt(X))+1):
            a = n
            exp = True
            while a > 1:
                if a % b != 0:
                    exp = False
                    break
                a //= b
            if exp:
                break
        if exp:
            break
    return n


def prob098():  # Cut and Count
    N = getInt()
    S = input()
    dmp((N, S))
    maxChCount = 0
    for i in range(1, N):
        before = S[:i]
        after = S[i:]
        dmp((before, after))
        chCount = 0
        for j in range(26):
            ch = chr(ord('a')+j)
            if ch in before and ch in after:
                chCount += 1
        maxChCount = max(maxChCount, chCount)
    return maxChCount


def prob099():  # Stone Momument
    a, b = getIntList()
    height = 0
    for i in range(b-a+1):
        height += i
    height -= b
    return height


def prob103():  # String Rotation
    S = input()
    T = input()
    for i in range(len(S)):
        S = S[1:] + S[0]
        dmp(S)
        if S == T:
            return 'Yes'
    else:
        return 'No'


def prob000():  # 
    return 0


debug = False  # True False
print(prob103())

Submission status: Accepted

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

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

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

print('No')

Submission status: Accepted

Solution code:
def main() -> None:
    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")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
s = list(input())
t = list(input())
for _ in range(len(s)):
    if s == t:
        print('Yes')
        sys.exit(0)
    s.insert(0, s.pop())
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:
s = input()
t = input()

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

torf = False

for i in range(len(s)):
    if rolling(s, i) == t:
        torf = True
        break

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

Submission status: Accepted

Solution code:
a=input()
b=input()
alist=list(a)
blist=list(b)
ans=0
for i in range(len(alist)):
  if(alist==blist):
    ans=1
  kari3=[]
  kari3.extend(alist[-1])
  kari3.extend(alist[:len(alist)-1])
  alist=kari3
  
if(ans==0):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

sset = set(s)
tset = set(t)

if sset != tset:
    print('No')
    exit()

# for i in range(len(s)):
#     temp = ''
#     for j in range(i, i + len(s)):
#         if j > len(s) - 1:
#             j = j - i
#         temp = temp + s[j]
#     print(temp)

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
# B
S = str(input())
T = str(input())
result = False

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

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

Submission status: Accepted

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

n = len(S)

ans = 'No'

for i in range(n):
    if ans == 'Yes':
        break
    if S[i] != T[0]:
        continue
    for j in range(n):
        k = i if i+j < n else i-n
        if S[k+j] != T[j]:
            break
        if j == n-1:
            ans = 'Yes'

print(ans)

Submission status: Accepted

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

flg = False

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

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

Submission status: Accepted

Solution code:
s = str(input())
t = str(input())
import sys
s_ = s
if s_ == t:
    print('Yes')
    sys.exit()

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

print('No')

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
ans = "No"
for i in range(len(s)):
    if s == t:
        ans = "Yes"
    s.append(s[0])
    del(s[0])
print(ans)

Submission status: Accepted

Solution code:
s=input()
t=input()
def turn(string):
    return string[-1]+string[0:-1]
turning=s
result=False
for i in range(len(s)):
    turning=turn(turning)
    if turning==t:
        print("Yes")
        result=True
        break

if result==False:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def word_rotation(s):
    s.insert(0,s.pop())

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

for i in range(len(S)):
    word_rotation(S)
    if S == T:
        print("Yes")
        break
else:
    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"
print(ans)

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

Submission status: Accepted

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

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

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

print('No')

Submission status: Accepted

Solution code:
S = str(input())
T = str(input())
S = list(S)
list = []
c = 0
for i in range(len(S)):
    S.insert(0,S[len(S)-1])
    S.pop()
    #print(S)
    temp = ""
    for j in range(len(S)):
        temp += S[j]
    #print(temp)
    if temp == T:
        c = 1
        break
if c == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
T = input()
text = "No"
import array
for c in S:
    if S == T:
        text = "Yes"
        break
    S = S[-1] + S[:-1]
print(text)

Submission status: Accepted

Solution code:
s=list(input())
t=list(input())
ok=False
for x in range(len(s)):
    l=s[-1]
    s.pop(len(s)-1)
    s.insert(0,l)
    if s==t:
        ok=True
print("Yes"if ok else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(str,input()))
t = list(map(str,input()))
ans = 0
a = 0
for i in range(len(s)):
    if s == t:
        ans = 1
    S = s[0]
    s.pop(0)
    s.append(S)
if ans == 1:
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
T=input()
T_0_equal=[]
for i in range(len(S)):
  if(T[0]==S[i]):
    T_0_equal.append(i)
#print(T_0_equal)
for i in range(len(T_0_equal)):
  count=0
  for j in range(len(S)):
    if(T[j]!=S[(j+T_0_equal[i])%len(S)]):
      break
    else:
      count+=1
  if(count==len(S)):
  	print('Yes')
  	exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    T = lines.pop(0)
    for i in range(len(S)):
        S = S[-1] + S[:-1]
        if S == T:
            print('Yes')
            sys.exit(0)

    print('No')

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#abcdefg
#abcdegg\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#x,y= (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
s = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意

t = input()
l = len(t)
a=t
for i in range(l):
    b = [a[l-1],a[:l-1]]
    a = ''.join(b)
    if a==s:
        j(1)
j(0)

Submission status: Accepted

Solution code:
S = input()
s = S * 2
ans = []
T = input()
for i in range(len(S)):
    x = s[i:i+len(S)]
    ans.append(x)
if T in ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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


main()

Submission status: Accepted

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

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


def main():
    ans = solve()
    if ans:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def main():
    s = input()
    t = input()
    n = len(s)
    flag = False
    for i in range(n):
        s = rot(s)
        if s == t:
            flag = True
    print("Yes" if flag else "No")

def rot(s):
    r = s[1:] + s[0]
    return r

main()

Submission status: Accepted

Solution code:
def main():
    x = input()
    y = input()

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

    if y in l:
        print("Yes")
    else:
        print("No")


def main2():
    x = input()
    y = input()
    ans = False

    s = x
    for i in range(len(x)):
        if s == y:
            ans = True
            break
        s = s[-1] + s[:-1]

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


if __name__ == '__main__':
    main2()

Submission status: Accepted

Solution code:
x = input()
y = input()

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

if y in l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

answer = 'No'

if S == T:
  answer = 'Yes'

else:
  for i in range(len(S)):
    S.insert(0, S.pop())
    if S == T:
      answer = 'Yes'

print(answer)

Submission status: Accepted

Solution code:
""" AtCoder """

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(100):
    s = s[i:]+s[-i:]
    if t in s:
        print("Yes")
        exit()
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:
def rotate(s,time):
    return s[-time:]+s[0:-time]

s = input()
t = input()
ok = False
for i in range(len(s)):
    if rotate(s,i) == t:
        ok = True
print('Yes' if ok else 'No')

Submission status: Accepted

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

s=s*2

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

Submission status: Accepted

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

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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