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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

success = 0

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

if success >= 1:
    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 = input()
T = input()

characters_num = len(T)

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

print(answer)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
slist=[]
tlist=[]
for i in s:
  slist.append(i)
slist.sort()
for i in t:
  tlist.append(i)
tlist.sort()
if slist==tlist:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

t2 = T + T

if set(S) == set(T):
  i = t2.find(S[0])
  for j in range(1, len(S)):
    if S[j] == t2[i+1]:
      i += 1
      r = 'Yes'
    else:
      r = 'No'
      break
else:
  r = 'No'
  
print(r)

Submission status: Wrong Answer

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

ch=0

for i in range(len(s)):
  s.insert(0,s[-1])
  s.remove(s[-1])
  if t==s:
    ch+=1

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

Submission status: Wrong Answer

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

s.sort()
t.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

S = input()
T = input()

s = collections.Counter(S)
t = collections.Counter(T)

if s == t:
    print('Yes')
else:
    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
    S = S[-1] + S[1:]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Wrong Answer

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

for s, t in zip(S, T):
    if s != t:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

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:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    l = len(S)
    
    def judge():
        for i in range(1, l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False
    
    if judge():
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

u = deque(s)
ok = False
for i in range(len(s)):
  u.rotate()
  if str(u) == t:
    ok = True
    
print('Yes' if ok else 'No')

Submission status: Wrong Answer

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

x=len(s)

ch1=0
ch=0

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

for j in range(x):
  if s[j]==t[j]:
    ch1+=1
    
print('Yes') if ch==x or ch1==x else print('No')

Submission status: Wrong Answer

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

a=input()
b=input()

for i in range(len(a)):
    a=rolling(a,i)
    if a==b:
        print('Yes')
        exit()


print('No')

Submission status: Wrong Answer

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

a=input()
b=input()

for i in range(len(a)):
    if a==b:
        print('Yes')
        exit()
    a=rolling(a,i)

print('No')

Submission status: Wrong Answer

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

a=input()
b=input()

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

Submission status: Wrong Answer

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

a=list(input())
b=list(input())

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

Submission status: Wrong Answer

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

a=list(input())
b=list(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
flag = True
for i in range(len(s)):
    if s[i] != t[-i-1]:
        flag = False
if flag:
    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 == t:
        print('Yes')
        exit(0)
    a = s[-1]
    s.pop(0)
    s.append(a)
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ss = sorted(s)
tt = sorted(t)

if ss == tt:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
a1 = sorted(a)
b1 = sorted(b)
if(a1 == b1):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

flg = False

for i in range(0,len(S)-1):
    temp = S[-i-1:]
    
    ret = temp + S[:len(S)- i -1]
    
    if ret == T:
        flg = True
        break
        
        
if flg == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

S = input()
T = input()

sl = np.array(list(S))
l = [''.join(np.roll(sl, i)) for i in range(len(S) - 1)]
print('Yes' if T in l else 'No')

Submission status: Wrong Answer

Solution code:
import itertools

S = list(input())
T = tuple(input())
flag = True
for s in itertools.permutations(S):
    if s == T:
        print('Yes')
        flag = False
        break
if flag:
    print('No')

Submission status: Wrong Answer

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

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:
N = list(input())
M = list(input())
count =0
for i in range(len(N)+1):
  
  a = M.pop(0)
  M.append(a)
  if M == N:
    count +=1
if count == 1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N = list(input())
M = list(input())
count =0
for i in range(len(N)):
  
  a = M.pop(0)
  M.append(a)
  if M == N:
    count +=1
if count == 1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
try:
    j = T.index(S[0])
    for i in range(len(S)):
        if S[i] != T[(j+i)%len(S)]:
            print("No")
            break
    else:
        print("Yes")
except:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
S = str(input())
T = str(input())

S = sorted(S)
T = sorted(T)

for i in range(len(S)):
    if S[i] != T[i]:
        print("No")
        sys.exit()
        
print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
p=input()
q=input()
s=len(p)
u=0
l=len(q)
for i in range(l):
    if p==q[i:s+i]:
        print("Yes")
        u=1
        break
if u==0:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans =""
for i in reversed(S):
    ans += i

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

Submission status: Wrong Answer

Solution code:
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

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

ans = ans(s,t)

print(ans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s.sort()
t.sort()
flag = True

for i in range(len(s)):
    s.insert(0,s.pop(-1))
    if "".join(s) == "".join(t):
        print("Yes")
        flag = False
        break



if flag:
    print("No")

Submission status: Wrong Answer

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

s.sort()
t.sort()

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

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=0
if s==t:
    flag=1
for i in range(len(s)//2+1):
    s.insert(0,s[-1])
    s.pop(-1)
    if s==t:
        flag=1
if flag==1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
flag=0
if s==t:
    flag=1
for i in range(len(s)//2):
    s.insert(0,s[-1])
    s.pop(-1)
    if s==t:
        flag=1
if flag==1:
    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]
    if T==S:
        print('Yes')
        exit()
    print(S)
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=input()
B=input()
if "A" in "B*3":
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b=input(),input();print('YNeos'[a!=b and a!=b[::-1]::2])

Submission status: Wrong Answer

Solution code:
print('YNeos'[input()==input()[::-1]::2])

Submission status: Wrong Answer

Solution code:
S=list(str(input()))
T=list(str(input()))
for i in range(len(S)//2 +2):
  if S==T:
    print('Yes')
    exit()
  a=S.pop(-1)
  S.insert(0,a)
print('No')

Submission status: Wrong Answer

Solution code:
S=list(str(input()))
T=list(str(input()))
for i in range(len(S)//2 +1):
  if S==T:
    print('Yes')
    exit()
  a=S.pop(-1)
  S.insert(0,a)
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = deque(list(S))
t = deque(list(T))

n = len(s)
for i in range(n):
    if t == s:
        print("yes")
        break
    a = t.popleft()
    t.append(a)
else:
    print("no")

Submission status: Wrong Answer

Solution code:
S = sorted(input()) 
T = sorted(input())
flag = 0
for i in range(len(S)):
    if S[i] != T[i]:
        flag = 1
        break
if flag == 1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

# check
S.sort()
T.sort()
if "".join(S) == "".join(T):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

# check
if "".join(S) == "".join(T):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

S = input()
T = input()

N = len(S)

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

Submission status: Wrong Answer

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

N = len(S)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
s=list(S)
T=input()
t=list(T)
for i in range(len(s)):
  s.insert(0,s[-1])
  print(s)
  s.pop(-1)
  
  print(s)
  if s==t:
    print('Yes')
    exit()
  
print('No')

Submission status: Wrong Answer

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

def change(s):
    u=str()
    for i in range(len(s)):
        if i==0:
            u+=s[len(s)-1]
        else:
         u+=s[i-1]
    return u

flag=False

if(s==t): 
    print("Yes")
    flag=True

for i in range(len(s)-1):
    s=change(s)
    #print(s)
    if(s==t):
        print("Yes")
        flag=True
        break

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

Submission status: Wrong Answer

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

def change(s):
    u=str()
    for i in range(len(s)):
        if i==0:
            u+=s[len(s)-1]
        else:
         u+=s[i-1]
    return u

flag=False

if(s==t): 
    print("Yes")
    frag=True

for i in range(len(s)-1):
    s=change(s)
    #print(s)
    if(s==t):
        print("Yes")
        flag=True
        break

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

Submission status: Wrong Answer

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

def change(s):
    u=str()
    for i in range(len(s)):
        if i==0:
            u+=s[len(s)-1]
        else:
         u+=s[i-1]
    return u

flag=False

if(s==t): 
    print("Yes")
    frag=True

for i in range(len(s)-1):
    s=change(s)
    if(s==t):
        print("Yes")
        flag=True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

s = [_ for _ in input()]
t = [_ for _ in input()]

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

Submission status: Wrong Answer

Solution code:
s=sorted(input())
t=sorted(input())
print('YNeos'[s!=t::2])

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

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

Submission status: Wrong Answer

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

ans = 0

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

print("Yes") if ans > 0 else print("No")

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
s = list(input())[:-1]
t = list(input())[:-1]
ls = Counter(s)
lt = Counter(t)
if ls == lt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    '''
    code here
    '''
    S = input()
    T = input()

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

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
s_str = [0] * 26
t_str = [0] * 26
alpha = 'abcdefghijklmnopqrsruvwxyz'
for i in range(26):
  s_str.append(s.count(alpha[i]))
  t_str.append(t.count(alpha[i]))
if s_str == t_str:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from collections import deque

S = deque(input())
T = deque(input())

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

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] != 'A':
    print('WA')
elif S[2:-1].count('C') != 1:
    print('WA')
else:
    S = list(S[1:])
    S.remove('C')
    S = ''.join(S)
    if S.islower():
        print('AC')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
from collections import deque

s = input()
t = input()

t = deque(t)
for i in range(len(s)):
  if s=="".join(t):
    print("Yes")
    exit()
  t.append(t.popleft())

Submission status: Wrong Answer

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

for i in range(len(S) - 1, -1, -1):
    if S[i:] + S[:i] == T:
        print('yes')
        break
else:
    print('no')

Submission status: Wrong Answer

Solution code:
#AtCorder Begginer Contest 103 - String Rotation
S=input()
T=input()
flg=0
for i in range(len(T)):
    T=T[-1]+T[:-1]
    if S == T:
        print("YES")
        break
else:
    print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if S==T:
  print("Yes")
  
ans = 0
for i in range(len(S)+1):
  if S == T:
    ans = 1
    break
  else:
    S.append(S.pop(0))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
#print(''.join(sorted(a)),(sorted(a)))
if ''.join(sorted(a))==''.join(sorted(b)):
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = len(s)

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

print("No")

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

Solution code:
# coding:utf-8
s = list(input())
t = list(input())
s.sort()
t.sort()
# print(s, t)
if s == t:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
for _ in range(len(s)-1):
    if s == t:
        print("Yes")
        quit()
    else:
        end = s.pop(0)
        s.append(end)
print("No")

Submission status: Wrong Answer

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

N=len(S)

flag=0
for i in range(N):
  if S[0]!=T[0]:
    T.append(T[0])
    del T[0]
  elif S[0]==T[0]:
    #print(i,T)
    flag=1
    for j in range(1,N):
      if S[j]!=T[j]:
        flag=0
    break
        
print('Yes' if flag==1 else 'No')

Submission status: Wrong Answer

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

l = len(S)
count = 0

for i in range(l):
    for j in range(l):
        if i+j >= l:
            if S[i+j-l] == T[j]:
                count += 1
            else:
                break
        else:
            if S[i+j] == T[j]:
                count += 1
            else:
                break

    if count == l:
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
l=len(S)
if S==T:
    print("Yes")
    exit()
 
for i in range(10*l):
    tmp=S[-1]
    S=S.strip(S[-1])
    new_string=tmp+S
    
    if new_string==T:
        print("Yes")
        exit()
    
    S=new_string
 
print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
l=len(S)
if S==T:
    print("Yes")
    exit()

for i in range(l):
    tmp=S[-1]
    S=S.strip(S[-1])
    new_string=tmp+S
    
    if new_string==T:
        print("Yes")
        exit()
    
    S=new_string

print("No")

Submission status: Wrong Answer

Solution code:
S,T=open(0);print('YNeos'[sorted(S)!=sorted(T)::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

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

Submission status: Wrong Answer

Solution code:
import collections

S = sorted(collections.Counter(input()).items())
T = sorted(collections.Counter(input()).items())
print("Yes"if S==T else "No")

Submission status: Wrong Answer

Solution code:
import collections

S = input()
T = input()

print("Yes" if collections.Counter(S) == collections.Counter(T) else "No")

Submission status: Wrong Answer

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

else:
    flag=True
    for i in range(1,len(s)-1):
        if s[0:i]==t[len(t)-i:len(t)] and s[i:len(s)]==t[0:len(t)-i]:
            print("Yes")
            flag=False
            exit()

    if flag:
        print("No")

Submission status: Wrong Answer

Solution code:
import sys

s=input()
t=input()
r=""

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

Submission status: Wrong Answer

Solution code:
import sys

s=input()
t=input()
r=""

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

Submission status: Wrong Answer

Solution code:
import sys

s=input()
t=input()
r=""

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

Submission status: Wrong Answer

Solution code:
import sys

s=input()
t=input()
r=""

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
ans = 'No'
s = [S[i] for i in range(len(S))]
for i in range(len(S)):
    s.append(S[i])
for i in range(len(S)):
    for j in range(len(S)):
        if s[i + j] != S[i]:
            break
        else:
            ans = 'Yes'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
k=0
for i in range(len(t)):
    if s[i]==t[i]:        
        print('Yes')
        exit()
    elif k==len(t):print('No')
    else:
      s.insert(0,s.pop(-1))
      k+=1

Submission status: Wrong Answer

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

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