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: Wrong Answer

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

ans = 'Yes'

for i in range(len(s)):
    if s[i] in t:
        t.replace(s[i], '', 1)
    elif s[i] not in t:
        ans = 'No'
        break


print(ans)

Submission status: Wrong Answer

Solution code:
stra = input()
strb = input()

stra = list(stra)
strb = list(strb)

for s in strb:
	if s in stra:
		stra.remove(s)
	else:
		pass
		
if len(stra) == 0:
	print("Yes")
else:
        print("No")

Submission status: Wrong Answer

Solution code:
write_1 = input()
write_2 = input()

print("Yes" if sorted(write_1) == sorted(write_2) else "No")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
LS=list(S)
LT=list(T)
N=len(LS) 
flag = -1
for i in range(N+1):
  X=LS.pop()
  LS.insert(0,X)
  if LS==LT:
    flag = 1
if flag == 1:
  print("Yes")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
c = dict()
T2 = list(T)
for i in T2:
    c[i] = T2.count(i)
for i in S:
    if i in T2 and c[i] == S.count(i):
       f = True

    else:
        f = False
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
N = []
counter = 0
for s in S:
    for i,t in enumerate(T):
        if i not in N:
            if t == s:
                N.append(i)
                counter += 1

if counter == len(S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
input_x = str(input())
input_y = str(input())
tmp = input_y
ary = []
for i in input_y:
    ary.append(i)
mongon = "Yes"
for c in input_x:
    if tmp.find(c) != -1:
        ary.pop(tmp.find(c))
        tmp = "".join(ary)
    else:
        mongon = "No"
        break

print(mongon)

Submission status: Wrong Answer

Solution code:
import sys

s = input()
t = input()

sLen = len(s)

for i in range(sLen):
    sRote = s[1:sLen] + s[0]
    s = sRote
    print(s)
    if s == t :
        #print("Yes")
        sys.exit()

print("No")

Submission status: Wrong Answer

Solution code:
stra = input()
strb = input()

stra = list(stra)
strb = list(strb)

for s in strb:
	if s in stra:
		stra.remove(s)
	else:
		print("No")
		
if len(stra) == 0:
	print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
LS=list(S)
LT=list(T)
N=len(LS) 
flag = -1
for i in range(N):
  X=LS.pop()
  LS.insert(0,X)
  if LS==LT:
    flag = 1
if flag == 1:
  print("Yes")
else:
  print("NO")

Submission status: Wrong Answer

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

flag = 0

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

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

Submission status: Wrong Answer

Solution code:
# your code goes here
S = list(input().split())
T = list(input().split())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets

setS = f(input())
setT = f(input())

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    S = input().strip()
    T = input().strip()
    move = S[-1]+S[:-1]
    j = True
    if S == T:
        print("Yes")
    if move == T:
        print("Yes")
        j = False
    while j:
        move = move[-1]+move[:-1]
        if move == T:
            print("Yes")
            j = False
        elif move == S:
            print("No")
            j = False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

s = input()
t = input()

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

if sorted(s) != sorted(t):
    print('No')
    sys.exit(0)

can = False
n = len(s)
for i in range(1, n):
    if s[i:] == t[:n-i]:
        if s[:n-i+1] == t[i-1:]:
            can = True
            break

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

Submission status: Wrong Answer

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

flag = 0

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

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

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
s_list = list(s)
t_list = list(t)
index = len(s_list)-1
ans=''
for i in range(len(s_list)):
    s_list = [s_list[index]] + s_list[0:index]
    if s_list == t_list:
        print('Yes')
        ans = 'yes'
if ans == '':
    print('No')

Submission status: Wrong Answer

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

count = 0

while s != t and count <= (len(s)-1):
    count += 1
    s.insert(0, s[-1])
    del s[-1]
    
if count >= (len(s)-1):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
tmp=s
flag=False
for i in range(len(s)):
    if(t==tmp):
        flag=True
        break
    tmp=""
    for j in range(len(s)):
        c=i+j
        if(c>=len(s)):
            c-=len(s)
        tmp+=s[c]


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

Submission status: Wrong Answer

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

sl = list(s[:])
tl = list(t[:])

sl.sort()
tl.sort()
"""
for i in range(len(sl)):
    if sl[i] == tl[i]:
        continue
    else:
        break
else:
    flg = 1
"""
if sl == tl:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data1 = list(input())
data2 = list(input())

data1.sort()
data2.sort()

if data1 == data2:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def str_rot(a, b):
    i = 0
    while a != b and i < len(a)-1:
        a = a[-1] + a[:-1]
        i += 1

    if a != b:
        return 'No'
    else:
        return 'Yes'

Submission status: Wrong Answer

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

count = 0

while s != t and count < (len(s)-1):
    count += 1
    s.insert(0, s[-1])
    del s[-1]
    
if count >= (len(s)-1):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
a = []
b = []
for i in s:
    a.append(i)
for j in t:
    b.append(j)

a.sort()
b.sort()
flag = True
for i in range(len(a)):
    if a[i] == b[i]:
        continue
    else:
        flag = False
        break

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

Submission status: Wrong Answer

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


def main():
    S = input().strip()
    T = input().strip()
    move = S[-1]+S[:-1]
    j = True
    while j:
        move = move[-1]+move[:-1]
        if move == T:
            print("Yes")
            j = False
        elif move == S:
            print("No")
            j = False


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

n = input()
m = input()

d = {}

for i in n:
    d[i] = d.get(i,0)+1 

for i in m:
    d[i] = d.get(i,0)-1

flag = True
for i in d:
    if d[i] != 0:
        flag = False
        
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

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

sl = list(s[:])
tl = list(t[:])

sl.sort()
tl.sort()

for i in range(len(sl)):
    if sl[i] == tl[i]:
        continue
    else:
        break
else:
    flg = 1

if flg == 1 and len(s) == len(t):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sl = list(s[:])
tl = list(t[:])

sl.sort()
tl.sort()

for i in range(len(sl)):
    if sl[i] == tl[i]:
        continue
    else:
        break
else:
    flg = 1

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

Submission status: Wrong Answer

Solution code:
from collections import deque
S = input()
T = input()
q = deque(list(S))
OK = False
for i in range(len(S)):
    last = q[-1]
    q.pop()
    q.appendleft(last)
    ans = list(q)
    ans = ''.join(ans)
    if ans == T:
        print ("Yes")
        OK = True
if OK == False:
    print ("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def str_rot(a, b):
    i = 0
    while a != b and i < len(a)-1:
        a = a[-1] + a[:-1]
        i += 1
    
    if a != b:
        return False
    else:
        return True

Submission status: Wrong Answer

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

sr = s[::-1]

if sr == t :
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
N = len(S)
i = 1
Judge = "No"
while i < N:
    if S == T:
        Judge = "Yes"
        break
    else:
        S = S[N-1]+S[:N-1]
        i += 1
print(Judge)

Submission status: Wrong Answer

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

def match(a, b):
    for i in range(len(a)):
        if a[i:] + a[:i] == b:
            return True

    return False

if match(s, t):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

for x in s:
    try:
        t.remove(x)
    except ValueError:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
a = []
b = []
for i in s:
    a.append(i)
for j in t:
    b.append(j)

a.sort()
b.sort()

if a == b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
si = input()
test = input()

si *=2
if test in si:
    print("Yes")
else:
    print('NO')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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):
    if sr==t :
      return("Yes")
    for i in range(le):
      sr[i]=s[(i+j)%le]
  return("No")

print(rotate())

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
ans="NO"
for i in range(len(s)):
    if s==t:
        ans="YES"
        break
    temp=s.pop()
    s.insert(0,temp)
print(ans)

Submission status: Wrong Answer

Solution code:
input_a = input()
input_b = input()

a = dict.fromkeys(set(input_a), 0)
for x in input_a:
    a[x] += 1

b = dict.fromkeys(set(input_b), 0)
for x in input_b:
    b[x] += 1

print('Yes' if a == b else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slst = list(s)
tlst = list(t)
slst.sort()
tlst.sort()
if slst == tlst:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S, T):

    sc = Counter()
    tc = Counter()
    for c in S:
        sc[c] += 1
    for c in T:
        tc[c] += 1

    if len(sc.keys()) != len(tc.keys()):
        return 'No'

    for k in sc.keys():
        if k not in tc:
            return 'No'
        if sc[k] != tc[k]:
            return 'No'

    return 'Yes'


def main():
    S = read_str()
    T = read_str()
    print(slv(S, T))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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]
  print(tmp_S)
  if tmp_S == T:
    flag = True

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = []
a += input()
b = []
b += input()
a.sort()
b.sort()
if a == b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if (len(a) != len(b)):
  print("NO")
  exit(0)
for i in range(len(a)):
  if a[i:] + a[:i] == b:
    print("YES")
    exit(0)
print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 'Yes'

for w in s:
    if w not in t:
        ans = 'No'
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

def main():
    s = input()
    t = input()
    
    print(s in 2*t)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

ss.sort()
ts.sort()

if ss == ts:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if len(S)%2==1:
    if T == S[::-1]:
        print("Yes")
    else:
        print("No")
else:
    if T == S[::-1]:
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

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

if len(S)%2==0:
    if T == S[::-1]:
        print("Yes")
    else:
        print("No")
else:
    if T == S[::-1]:
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
if set(a)==set(b):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if T == S[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

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


def iter(string, dic):
    for i in range(len(string)):
        if string[i] in dic.keys():
            dic[string[i]] += 1
        else:
            dic[string[i]] = 1
    return dic


s_pattern = Counter(s)
t_pattern = Counter(t)


def check(string, original):
    count = 0
    length = len(string)
    flag = False
    while 1:
        if string == original:
            flag = True
            break
        if count == length:
            flag = False
            break
        last = string[-1]
        string = last + string[:-1]
    return flag


if s_pattern != t_pattern:
    print('No')
else:
    if check(s, t):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
from collections import defaultdict
s = input()
t = input()
s_dic = defaultdict()
t_dic = defaultdict()


def iter(string, dic):
    for i in range(len(string)):
        if string[i] in dic.keys():
            dic[string[i]] += 1
        else:
            dic[string[i]] = 1
    return dic


s_pattern = iter(s, s_dic)
t_pattern = iter(t, t_dic)


def check(string, original):
    count = 0
    length = len(string)
    flag = False
    while 1:
        if string == original:
            flag = True
            break
        if count == length:
            flag = False
            break
        last = string[-1]
        string = last + string[:-1]
    return flag


if s_pattern != t_pattern:
    print('No')
else:
    if check(s, t):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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]

Submission status: Time Limit Exceeded

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

    if is_match_swith_rotation(s, t):
        print('Yes')
    else:
        print('No')

def is_match_swith_rotation(s, t):
    end = l = len(t)
    while end != 0:
        try:
            pos = s.rfind(t[0], 0, end)
        except ValueError:
            return False
        if s[pos:] == t[:l-pos] and s[:pos] == t[l-pos:]:
            return True
        end = pos

    return False

main()

Submission status: Time Limit Exceeded

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

    if is_match_swith_rotation(s, t):
        print('Yes')
    else:
        print('No')

def is_match_swith_rotation(s, t):
    end = len(t)
    while end != 0:
        try:
            pos = s.rfind(t[0], 0, end)
        except ValueError:
            return False
        if s[pos:] + s[:pos] == t:
            return True
        end = pos

    return False

main()

Submission status: Accepted

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

match = 0

for _ in S:
    i = S.pop()  # 末尾を削除し値を取得
    S.insert(0, i)  # index[0]の位置にiを追加
    ''.join(S)  # リストを結合
    if S == T:
        match += 1
        break

if match == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

num = len(T)

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

print(answer)

Submission status: Accepted

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

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()
String1 = list(S)
String2 = list(T)
N = len(String1)



for i in range(1,N):
    if String1 == String2:
        print("Yes")
        break
    Ex = String1.pop()
    String1.insert(0,Ex)
    if String1 == String2:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

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

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    S = input()
    T = input()

    return S, T


def main(S: str, T: str) -> None:
    """
    メイン処理.

    Args:\n
        S (str): 英子文字からなる文字列(2 <= |S| <= 100)
        T (str): 英子文字からなる文字列(|S| = |T|)
    """
    # 求解処理
    N = len(S)
    ans = "No"
    for i in range(N):
        if S[-i:] + S[:-i] == T:
            ans = "Yes"
            break

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    S, T = get_input()

    # メイン処理
    main(S, T)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()
T = input()

# 求解処理
N = len(S)
ans = "No"
for i in range(N):
    if S[-i:] + S[:-i] == T:
        ans = "Yes"
        break

# 結果出力
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
ans = 'No'

for _ in s:
    tmp = s.pop()
    s.insert(0, tmp)
    ''.join(s)
    if s == t:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

success = 0

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

if success >= 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
T = str(input())
ans_list = []

for i in range(len(S)):
    i = S[-1] + S[0:-1]
    ans_list.append(i)
    S = i

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = input()
# s,tをリストにする
s = list(s)
t = list(t)

# 変数count,judgementに0を代入
count = 0
judgment = 0

# sの長さだけ順番入れ替えを繰り返し
while count <= len(s):
    item = s.pop()
    s.insert(0,item)
    if s == t:
        # s==tになったらjudgmentでカウントアップ
        judgment += 1
    # 回数をカウントアップ
    count +=1

# 一回もs==tになってなければNo
if judgment == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

count = 0
judgment = 0

while count <= len(s):
    count +=1
    item = s.pop()
    s.insert(0,item)
    if s == t:
        judgment += 1

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

Submission status: Accepted

Solution code:
import copy
s = list(input())
t = list(input())
bool = False
for i in range(len(s)):
    temp = copy.copy(s)
    if s == t:
        bool = True
    for j in range(len(s)):
        if j == 0:
            s[0] = temp[len(s) - 1]
        else:
            s[j] = temp[j - 1]
if bool:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main(): 
    s = list(input().rstrip())
    t = input().rstrip()
    for i in range(len(s)):
        if t == "".join(s):
            print("Yes")
            exit()
        else:
            tmp=s.pop(0)
            s.append(tmp)
    print("No")



if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    s = input()
    t = input()
    x = len(s)

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

    print("No")


main()

Submission status: Accepted

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

characters_num = len(T)

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

Submission status: Accepted

Solution code:
s = input()
t = input()
res = "No"

def rotate(a):
  n = len(a)
  a = a[n-1] + a[:n-1]
  return a

for i in range(len(s)):
  if s == t:
    res = "Yes"
    break
  s = rotate(s)

print(res)

Submission status: Accepted

Solution code:

s=input()
t=input()
n=0

for i in range(len(s)):
    a=len(s)-1


    s=s[a]+s[0:a]
  
    if s==t:
        n=1
        break
        
        
if n==1:
    if len(s)==len(t):
        print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
T = input()
r = 'No'
t2 = T + T

if set(S) == set(T):
  if t2.count(S) > 0:
    r = 'Yes'
else:
  r = 'No'
  
print(r)

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

S=s+s
c=0

for i in range(len(s)):
  ch=0
  for j in range(len(s)):
    if S[i+j]==t[j]:
      ch+=1
  if ch==len(s):
    c+=1

if c>0:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
def answer(s: str, t: str) -> str:
    for _ in range(len(s)):
        if t == s:
            return 'Yes'
        s = s[-1] + s[:-1]
    return 'No'


def main():
    s = input()
    t = input()
    print(answer(s, t))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
str1 = input()
str2 = input()

print("Yes" if str2 in str1 * 2 else "No")

Submission status: Accepted

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

def ans103(S:str, T:str):
    jugde_count=0
    for i in range(0,len(S)):
        S=S[-1]+S[:-1]
        if T==S:
            jugde_count+=1
    if jugde_count>0:
        return "Yes"
    else:
        return "No"

print(ans103(S,T))

Submission status: Accepted

Solution code:
string = input()
rotated_string = input()
for i in range(len(string)):
    string = string[-1] + string[0:-1]
    if string == rotated_string:
        print('Yes')
        quit()
print('No')

Submission status: Accepted

Solution code:
print(('No', 'Yes')[input() in input() * 2])

Submission status: Accepted

Solution code:
s = str(input())
t = str(input())
N = len(s)
S = [0] * N
T = [0] * N

for i in range(N):
  S[i] = s[i]
  T[i] = t[i]
  
for i in range(N):
  for j in range(N):
    if j == 0:
      x = S[j]
      S[j] = S[j + 1]
    elif 1 <= j < N - 1:
      S[j] = S[j + 1]
    else:
      S[j] = x
  #print(S)    
  if S == T:
    print("Yes")
    quit()
    
print("No")

Submission status: Accepted

Solution code:
from itertools import groupby
class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i - 1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n - m] * self.finv[m] % self.mod) % self.mod
        
def iparse():
    return list(map(int, input().split()))


# RUN LENGTH ENCODING str -> tuple


def runLengthEncode(S: str):
    grouped = groupby(S)
    res = []
    for k, v in grouped:
        res.append((k, str(len(list(v)))))
    return res


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

Submission status: Accepted

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

ans = "No"
for i in range(len(s)):
    s0 = s[0]
    s.remove(s0)
    s.append(s0)
    if s == t:
        ans = "Yes"
        break

print(ans)

Submission status: Accepted

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