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, t = (input() for _ in range(2))
tmp = t
if s == tmp:
  print('Yes')
  exit()
if set(s) == set(t):
  for i in range(len(s)):
    tmp = tmp[-1] + tmp[:-1]
    if tmp == t:
      print('Yes')
      exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if s== t[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = raw_input()
T = raw_input()
list_S = list(S)
list_T = list(T)
ans = False
for i in range(len(list_T)):
        if list_S == list_T:
                ans = True
                break
        X = list_T.pop(0)
        list_T.append(X)
if ans:
        print "YES"
else:
        print "NO"

Submission status: Wrong Answer

Solution code:
for i in range(10):
  pass
else:
  print("Hoge")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s,t=open(0);print(" YNeos"[t in[s[i:-1]+s[:i]for i in range(99)]::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()[::-1]
if s == input():
    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:
        print("Yes")
        exit(0)
    s = s[len(s) - 1] + s[:len(s) - 1]

print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
for i in range(len(s)):
    tmp = s[-1]
    for j in range(len(s)-1)[::-1]:
        s[j+1] = s[j]
    s[0]=tmp
    if s == t:
        print("yes")
        break
else:
    print("no")

Submission status: Wrong Answer

Solution code:
from collections import deque
sin = [i for i in input()]
tin = [i for i in input()]
s = deque(sin)
s_origin = deque(sin)
t = deque(tin)
s.rotate(1)
while s!=s_origin:
    if s == t or s_origin == t:
        print("Yes")
        break
    s.rotate(1)
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(N-1):
    R = S.copy()

    for j in range(N):
        if j == N-1:
            S[0] = R[N-1]
        else:
            S[j+1] = R[j]

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

print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
x = ""
if s==t:
  print('Yes')
else:
  for i in range(len(s)):
    if s[i]==t[0] and i!=len(s)-1 and s[i+1]==t[1]:
      for j in range(i,len(s)):
        x += s[j]
      for k in range(i):
        x += s[k]
      print(x,end='\n')
      break
  print('Yes' if x==t else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
T = [j for j in input()] 

x = sorted(S)
y = sorted(T)
k = None
i = 0
if x == y:
  for i in range(101):
    O = S.copy()
    S.pop()
    S.insert(0,O[-1])
    i += 1
    if S == T:
      print("Yes")
      break
  else:
    print("NO")
else:
  print("No")

Submission status: Wrong Answer

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


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    #print(L)
    ans = "N0"
    #i:移動距離
    for i in range(1,len(S)+1):
        #移動
        for j in range(len(S)):
            list_S[j] = L[-i+j]
            #print(L,list_S)
        print(list_S)
        #print(L)
        if list_S == list_T :
            ans = "Yes"
            break
print(ans)

Submission status: Wrong Answer

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


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    #print(L)
    ans = "N0"
    #i:移動距離
    for i in range(1,len(S)):
        #移動
        for j in range(len(S)):
            list_S[j] = L[-i+j]
            #print(L,list_S)
        print(list_S)
        #print(L)
        if list_S == list_T :
            ans = "Yes"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
yes = False
for a in range(0, len(s)):
    if (s == t):
        print('Yes')
        yes = True
    s = s[1:] + s[:1]
if (not yes):
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

s = input()
t = input()

print('Yes' if sorted(s) == sorted(t) else 'No')

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
            cnt=0
if cnt%len(T)==0 or S == T:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
ans = False
if S == T:
    ans = True
else:
    for i in range(len(S)):
        if s[i]==T[0]:
            for j in range(len(T)):
                if s[i+j]==T[j]:
                    cnt +=1
            if cnt%len(T)==0:
                ans = True
if ans == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
ans=False
if S==T:
  ans=True
else:
  for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
        if cnt==len(T):
          ans=True
          
if ans==True:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt%len(T)==0 or S == T:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt>=len(T) or S == T:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
cnt = 0
s = S + S +S
for i in range(2*len(S)+1):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt==len(T) or S == T:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s1 = list(input())

s2 = list(input())

ans = 'No'

for i in range(len(s1)-1):
  if ("".join(s1) == "".join(s2)):
    ans = 'Yes'
    break
  last = s1.pop()
  s1.insert(0,last)
print(ans)

Submission status: Wrong Answer

Solution code:
s1 = list(input())

s2 = list(input())

ans = 'No'

for i in range(len(s1)-1):
  print(s1)
  if (s1 == s2):
    ans = 'Yes'
    break
  last = s1.pop()
  s1.insert(0,last)
print(ans)

Submission status: Wrong Answer

Solution code:
s1 = list(input())

s2 = list(input())

ans = 'No'

for i in range(len(s1)-1):
  if (s1 == s2):
    ans = 'Yes'
    break
  last = s1.pop()
  s1.insert(0,last)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

for _ in range(len(S)-1):
    if S == T:
        print("Yes")
        sys.exit()
    else:
        S.insert(0, S[-1])
        S.pop(-1)

print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

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

for _ in range(len(S)-1):
    if S == T:
        print("Yes")
        sys.exit()
    else:
        S.insert(0, S[-1])
        S.pop(-1)

print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

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

for _ in range(len(S)-1):
    if S == T:
        print("Yes")
        sys.exit()
    else:
        S.insert(0, S[-1])
        S.pop(-1)

print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

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

S.insert(0, S[-1])
S.pop(-1)

while True:
    if S == T:
        print("Yes")
        break
    elif S == s:
        print("No")
        break
    else:
        S.insert(0, S[-1])
        S.pop(-1)

Submission status: Wrong Answer

Solution code:
import sys

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

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

S.insert(0, S[-1])
S.pop(-1)

while True:
    S.insert(0, S[-1])
    S.pop(-1)
    if S == T:
        print("Yes")
        break
    elif S == s:
        print("No")
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

flag = False

for i in range(1,len(S)):
    word = "".join(S[-i:]+S[:len(S)-i])
    if word == T:
        flag = True

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

Submission status: Wrong Answer

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

sd = {}
td = {}
for c1 in s:
  if c1 not in sd:
    sd[c1] = 0
  sd[c1] += 1
  
for c2 in t:
  if c2 not in td:
    td[c2] = 0
  td[c2] += 1
if sd == td:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a_list = sorted(list(input()))
b_list = sorted(list(input()))
if a_list == b_list:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

st = False
for i in range(0,len(s)-1):
    s = s[-1]+s[0:len(s)-1]
    if s==t:
        st = True
        print("yes")
        break
if not st:
    print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = input()
s_tmp = S.copy()
if ''.join(S) == T:
  print('Yes')
else:
  while True:
    s_reversed = s_tmp[:-1]
    s_reversed.insert(0, s_tmp[-1])
    if S == s_reversed:
      print('No')
      break
    elif ''.join(s_tmp) == T:
      print('Yes')
      break
    s_tmp = s_reversed

Submission status: Wrong Answer

Solution code:
S = list(input())
T = input()
s_tmp = S.copy()
if S == T:
  print('Yes')
else:
  while True:
    s_reversed = s_tmp[:-1]
    s_reversed.insert(0, s_tmp[-1])
    if S == s_reversed:
      print('No')
      break
    elif ''.join(s_tmp) == T:
      print('Yes')
      break
    s_tmp = s_reversed

Submission status: Wrong Answer

Solution code:
S = list(input())
T = input()
s_tmp = S.copy()
while True:
  s_reversed = s_tmp[:-1]
  s_reversed.insert(0, s_tmp[-1])
  if S == s_reversed:
    print('No')
    break
  elif ''.join(s_tmp) == T:
    print('Yes')
    break
  s_tmp = s_reversed

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
rs=s[::-1]
if rs==t or s==t:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import copy
s = input()
t = input()
flag = True
listed_s = list(s)
swaped_s = list(s)
for i in range(len(s)):
    if "".join(listed_s) == t:
        flag = False
        print("Yes")
    swaped_s = [listed_s[-1] for i in range(len(s))]
    for i in range(len(s) - 1):
        swaped_s[i + 1] = listed_s[i]
    listed_s = copy.copy(swaped_s)

if flag:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
lsts = []
lstt = []
for i in s:
  lsts.append(i)
  lsts = sorted(lsts)
for j in t:
  lstt.append(j)
  lstt = sorted(lstt)
if lsts == lstt:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

flag = False

def rotate_string(string):
  return "".join((string[-1], string[:-1]))

# print(S)
# print(rotate_string(S))
if S == T:
  print("Yes")
  flag = True

for i in range(len(S)-1):
  S = rotate_string(S)
  if S == T:
    print("Yes")
    flag = True
    break
    
if not flag:
  print("No")

Submission status: Wrong Answer

Solution code:

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)):
        if s != t:
            temp = s[len(s)-1]
            s = s.rstrip(temp)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)-1):
        if s != t:
            temp = s[len(s)-1]
            s = s.rstrip(temp)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#n = int(input())
#h, w = map(int,input().split())
#ls = list(map(int,input().split()))
#ls = [list(map(int,input().split())) for i in range(n)]
#ls = [input() for i in range(h)]
s1 = input()
s2 = input()

for i in range(len(s1)):
  if s1[i:i+len(s1)] == s2:
    print("Yes")
    quit()
    
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
flag = False
for i in range(len(s)-1):
    flagi = True
    for j in range(len(s)):
        if(s[j] != t[(i+j) % len(s)]):
            flagi = False

    if(flagi):
        flag = True
if(flag):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 0

for i in S:
    if i in T:
        count += 1
    else:
        print("No")
        break

if len(T) == count:
    print("Yes")
else:
    ("No")

Submission status: Wrong Answer

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

ans = False
count = 0

for i in S:
    if i in T:
        count += 1
    else:
        print("No")
        break

if len(T) == count:
    print("Yes")

Submission status: Wrong Answer

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

N = len(S)

flag = False
for i in range(N):
  for j in range(N):
    if S[i+j-N] != T[j]:
      break
    flag = True

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
list_S = sorted(S)
list_T = sorted(T)
if list_S == list_T:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

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

for i in range(N):
    t = S[-1] + S[:-1]
    if t == T:
        flag = True
        break

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
Flag = True
N = len(S)
for i in range(N):
    if S[i] != T[N - 1 - i]:
        Flag = False
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

S_line = input()
T_line = input()

length = len(S_line)

index_list = []
def index_maker(start_n, length):
    for loc in range(length):
        if loc > start_n:
            index_list.append(loc)
        
    for loc in range(start_n + 1):
        #print(str(start_n) +":"+ str(loc))
        index_list.append(loc)
    if start_n + 1 == length:
        return list(range(length))

    return(index_list)

ac_flag = 0
index_list = []
y_flag = 0

for i in range(length):
    index_list = index_maker(length-1 - i, length)
    #print(index_list)
    for i, index in enumerate(index_list):
        #print("i: " + str(i) +" index: "+ str(index))
        if T_line[i] != S_line[index]:
            ac_flag += 1
    if ac_flag == 0:
        y_flag += 1
    ac_flag = 0
    index_list = []

if y_flag != 0:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

S_line = input()
T_line = input()

length = len(S_line)

index_list = []
def index_maker(start_n, length):
    for loc in range(length):
        if loc > start_n:
            index_list.append(loc)
        
    for loc in range(start_n + 1):
        #print(str(start_n) +":"+ str(loc))
        index_list.append(loc)
    if start_n + 1 == length:
        return list(range(length))

    return(index_list)

ac_flag = 0
index_list = []
y_flag = 0

for i in range(length):
    index_list = index_maker(i, length)
    #print(index_list)
    for i, index in enumerate(index_list):
        #print("i: " + str(i) +" index: "+ str(index))
        if T_line[index] != S_line[i]:
            ac_flag += 1
    if ac_flag == 0:
        y_flag += 1
    ac_flag = 0
    index_list = []

if y_flag != 0:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np

S_line = input()
T_line = input()

length = len(S_line)

index_list = []
def index_maker(start_n, length):
    for loc in range(length):
        if loc > start_n:
            index_list.append(loc)
        
    for loc in range(start_n + 1):
        #print(str(start_n) +":"+ str(loc))
        index_list.append(loc)
    if start_n + 1 == length:
        return range(length)

    return(index_list)

ac_flag = 0
index_list = []
y_flag = 0

for i in range(length):
    index_list = index_maker(i, length)
    for i, index in enumerate(index_list):
        if T_line[i] != S_line[index]:
            ac_flag += 1
    if ac_flag == 0:
        y_flag += 1
    ac_flag = 0
    index_list = []

if y_flag != 0:
    print("yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = sorted(list(input().rstrip()))
t = sorted(list(input().rstrip()))
if s == t:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
t = input()
flag = 0
  
for i in range(len(s)):
  tmp = s.pop(-1)
  s.insert(0, tmp)
  if "".join(s) == t:
    print("Yes")
    flag = 1

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

Submission status: Wrong Answer

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

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    elif S != T:
        S.insert(0,S[-1])
        del S[-1]
    elif i == len(S)-2:
        print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
ans = S
if S == T:
    print('Yes')
    exit()
for i in range(len(S)):
    Stmp1 = ans[-1]
    Stmp2 = "".join(ans[:-1])
    ans = Stmp1+Stmp2
    if ans == T:
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
ans = S
for i in range(len(S)):
    Stmp1 = ans[-1]
    Stmp2 = "".join(ans[:-1])
    ans = Stmp1+Stmp2
    if ans == T:
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

Solution code:
s = [str(x) for x in input()]
t = [str(x) for x in input()]

def solve(s_list,t_list,n):
    if n== 120:
        return print("No")
    a = s_list.pop(-1)
    s_list.insert(0,a)
    if s_list ==t_list:
        return print("yes")
    else:
        solve(s,t,n+1)

solve(s,t,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
for i in range(len(s)):
    if s.count(s[i])!=t.count(s[i]):
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
# 入力
S=list(input())
T=input()

# 回転
S.reverse()

# リストから文字列に戻す
S=''.join(S)

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

Submission status: Wrong Answer

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

for i in range(len(x)):
  if x[i:] + x[:i] == y:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if "".join(sorted(s)) == "".join(sorted(t)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if sorted(s) == sorted(t):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = "".join(sorted(input()))
t = "".join(sorted(input()))
if s == t:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if sorted(s) == sorted(t):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
cnt = 0
for i in range(len(S)):
    L = S[-i-1:] + S[0:-i-1]
    if L == T:
        cnt += 1
if cnt != 0:
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
ans='No'
for i in range(len(s)+1):
    if s==t:
        ans='Yes'
        break
    s.insert(0,s.pop())
    print(s)
print(ans)

Submission status: Wrong Answer

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

if len(s) != len(t):
    print("No")
    sys.exit()

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
for i in range(len(S)):
  U = S[-i: ] + S[: len(S) - i]
  print(S[-i: ], S[: len(S) - i], U)
  if U == T or S == T:
    print('Yes')
    exit()
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")
        break
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
S = input()
T = input()

S_list = Counter(S).most_common()
S_list.sort()
T_list = Counter(T).most_common()
T_list.sort()

if S_list == T_list:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

  for _ in range(len(S)-1):
    last = S[-1]
    S.pop(-1)
    S.insert(0, last)
    t = ''.join(S)
    # print(t, T, t == T)

    if t == T:
      print('Yes')
      return
      
  print('No')
  return

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

l = list(input())
s = list(input())

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

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
S_list = list(S)
T_list = list(T)
if set(S_list) == set(T_list):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = sorted(list(input()))
T = sorted(list(input()))
print("Yes" if S==T else "No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(len(S)):
    top = S[0]
    S = S[1:] + top
    if S == T:
        print('Yes')
        break
else:
    print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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