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:
import sys
s = str(raw_input())
t = str(raw_input())
if sorted(s) == sorted(t):
	for i in range(len(s)):
		s = s[1:] + s[0]
		print s
		if s == t:
			print 'Yes'
			sys.exit()
print 'No'

Submission status: Wrong Answer

Solution code:
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    break
if b==False:
  print("No")

Submission status: Wrong Answer

Solution code:
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[-1]
  del a[-1]
  a1=a[::-1]
  a1.append(s)
  a2=a1[::-1]
  if a2==s:
    b=True
    print("Yes")
    break
  else:
    pass
if b==False:
  print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
c = 0
for a in s:
    if s.count(a) == t.count(a):
        c += 1
if c == len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
c = 0
for a in set(s):
    if s.count(a) == t.count(a):
        c += s.count(a)
if c == len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
c = 0
for a in set(s):
    s.count(a) == t.count(a)
    c += s.count(a)
if c == len(s):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = False

for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

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

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(a)
    if a[j]!=b[i]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(a)
    if a[j]!=b[j]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
a=True
for i in range(101):
    if s==t:
        print("Yes")
        a=False
        break
    s=s[-1]+s[:-2]
if a:
    print("No")

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
a=0
while a<=100:
    a+=1
    s=s[-1]+s[:-2]
    if s==t:
        print("Yes")
        break
if a>100:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b = list(input()), list(input())
a.sort()
b.sort()
print('Yes' if a == b else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(len(s)):
    s.insert(0, s[-1])
    del s[0]
    if s == t:
        print("Yes")
        break
    elif i == len(s)-1:
        print("No")

Submission status: Wrong Answer

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

for i in range(len(s)):
    s.insert(0, s[-1])
    s.remove(s[-1])
    if s == t:
        print("Yes")
        break
    elif i == len(s)-1:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s.sort(),t.sort()
print("Yes") if s==t else print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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')
    break
  else:
    print(S[i:] + S[:i])
    if i == len(S)-2:
      print('No')
      break

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
alist=list(a)
blist=list(b)
alist.sort()
blist.sort()
ans=0
for i in range(len(alist)):
  if(alist[i]==blist[i]):
     ans+=1

if(ans==len(alist)):
  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[:len(s)-1]
    if s==t:
        print('Yes')
        break
    if i==len(s)-1:
        print('NO')

Submission status: Wrong Answer

Solution code:
# B
S = str(input())
T = str(input())
S = list(S)
T = list(T)
S.sort()
T.sort()
if S == T:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())
t=str(input())
print(s in t+t)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ls = ls2 = 0


s = list(s)
for i in s:
    ls += t.count(i)
    ls2 += s.count(i)

if ls == ls2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ls = ls2 = 0


s = list(s)
for i in s:
    ls += t.count(i)
    ls2 += s.count(i)


print(ls)
print(ls2)
if ls == ls2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

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


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

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

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


if __name__ == '__main__':
    pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
print(["No","Yes"][s.sort() == t.sort()])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

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

if len(S) != len(T):
    print('NO')
    exit()

import numpy as np

S_list = S
count = 0

for i in range(len(S)):
    S_list = np.append(np.array(S_list[-1]), S_list)
    S_list = list(S_list)
    S_list.pop(-1)
    
    if S_list == T:
        print('YES')
        exit()
    else:
        count += 1
if count == len(S):
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ls = len(s)
flag = False

for i in range(ls):
  s = s[-1:] + s[0:-1]
  #print(s)
  if s == t:
    flag = True
    break

if flag:
  print("Yes")

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    t = list(input())
    print(t)
    print(s)
    s_len = len(s)
    for i in range(s_len):
        if s == t:
            return
        tmp = s[0]
        s.pop(0)
        s.append(tmp)
    print(t)
    print(s)


main()

Submission status: Wrong Answer

Solution code:
a=list(input())
b=list(input())
hantei=True
for i in range(len(a)):
	c=[]
	c.append(a[-1])
	for i in range(0,len(a)-1):
		c.append(a[i])
	a=c
	if c==b:
		hantei=True
		break
	else:
		hantei=False

if hantei==False:
	print("No")
else:
	print("Yesk")

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
len = len(S)
T[0] = T[len-1]
if S == T:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
A=a*2
d= b in A
if d=="True":
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
a=len(s)
print(a)
cnt=0
for i in range(a):
    if s[i] in t:
        cnt+=1

if cnt==a:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#後方一致文字数を探索
def count_substr(s1, s2):
    s2_length = len(s2)
    for i in range(s2_length):
        substr = s2[0:(s2_length - i)]
        if s1.endswith(substr):
            return (len(substr))
    return 0


#文字列を取得
s = input()
t = input()

#部分一致文字数を探索
match_count = count_substr(s, t)

is_match = False
#後方一致が見つかった場合
if match_count > 0:
    #文字列を回転
    s = s[match_count+1:len(s)] + s[0:match_count+1]
    is_match = (s == t)

#出力
print("Yes" if is_match else "No")

Submission status: Wrong Answer

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

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

print('No')

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
num = len(S)
C = ''
count = 0
if S == T:
    count += 1
    print('Yes')
else:
    for n in range(num):
        S = str(S[-1] + S[:4])
        if T == S:
            count += 1
            print('Yes')
            break

if count == 0:
    print('No')

Submission status: Wrong Answer

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

l = len(a)
if a == b:
    print "yes"
else:
    state = 0
    for i in range(l-1):
        a = a[-1]+a[0:-1]
        if a == b:
            print "Yes"
            state = 1
            break
    if state == 0:
        print "No"

Submission status: Wrong Answer

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

l = len(a)
state = 0
for i in range(l-1):
    if a == b:
        print "Yes"
        state = 1
        break
    a = a[-1]+a[0:-1]
if state == 0:
    print "No"

Submission status: Wrong Answer

Solution code:
A = sorted(list(input()))
B = sorted(list(input()))
if  set(A) == set(B):
 print('Yes')
else:
 print('No')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
T = list(str(input()))
S.sort()
T.sort()
if S==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:len(s)]+s[0]
    print(s)
    if s==t:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] != 'A':
    print('WA')
    exit()
a=0
for i in range(2, len(S) - 1):
    if S[i]=='C':
        j=i
        a+=1
if a!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if (i!=0)&(i!=j):
        a=S[i]
        if a.isupper():
            print('WA')
            exit()
print('AC')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
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 = input()
t = input()
def_list = list()
for i in range(len(s)):
    if s[i] == t[i]:
        def_list.append(s[i])
if len(def_list)%2 == 0:
    print("Yes")
else:
    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
  else:
    t = t[-1] + t[:-1]
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a = list(input()).sort()
b = list(input()).sort()
if a == b:
  print("Yes")
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 = sorted(list(input()))
T = sorted(list(input()))

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print('No')

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

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:
"""
B - String Rotation
愚直に変換してチェックする
"""

s = input()
test = input()

for i in range(len(s)):
    s_right = s[i:]
    s_left = s[:i]

    s_rot = s_right + s_left
    
    print(s_rot)

    if s_rot == test:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
"""
B - String Rotation
愚直に変換してチェックする
"""

s = input()
test = input()

for i in range(len(s)-1):
    s_right = s[i:]
    s_left = s[:i]

    s_rot = s_right + s_left
    
    #print(s_rot)

    if s_rot == test:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())
t = str(input())
s = ''.join(sorted(s))
t = ''.join(sorted(t))

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
word = [x for x in T]
for i in range(len(word)):
    a = word[0]
    word.append(a)
    word.remove(a)
    if S == word:
        break
    else:
        pass
if S == word:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#103b
s=list(input())
t=list(input())

if s==t:
    print('Yes')
    exit()
for i in range(len(s)):
    s.insert(0,s[-1])
    del s[-1]
    if s==t:
        print('Yes')
        break
        exit()
print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(s, t)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def rotate(argstr):
    return argstr[len(argstr)-1] + argstr[0:len(argstr)-1]

str1 = "cat"
str2 = "tca"
ans = 'No'

if str1 == str2: ans = 'Yes'

for i in range(0, len(str1) - 1):
    str1 = rotate(str1)
    if str1 == str2: ans = 'Yes'

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 13:01:32 2018

@author: Takemura_Akihito
"""

count=0
b=[]

def check():
    count=0
    for i in range(len(a[0])):
        if(a[0][i]!=a[1][i]):
            break
        if(i==int(len(a[0])-1)):
            count=1
            print("Yes")
    return count


def change():
    b=[]
    for i in range(len(a[0])-1):
        b.append(a[1][i+1])
    b.append(a[1][0])
    
    return b



###変数を得る
a = []
for i in range(2):
    a.append(input())



check()

if(count==0):
    for i in range(len(a[0])-1):
        a[1]=change()
        count=check()
        if(count==1):
            break

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

n = len(S)
e = 0
for i in range(n):
    R = S[i:n] + S[0:i]
    if T == R:
        print("yes")
        e = 1
        break

if e == 0:
    print("no")

Submission status: Wrong Answer

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

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

print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
S_l = len(S)
while S_l != 0:
    if S == T:
        print("Yes")
        break
    S = S[-1]+S[0:-1]
    print(S)
    S_l -= 1
if S_l == 0:
    print("No")

Submission status: Wrong Answer

Solution code:
x=[]
for i in range(2):
	x.append(input())
#print(x)
if sorted(x[0])==sorted(x[1]):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

def checkStr(S, T):
    for i in range(len(T)-1):
        if S == (T[i:] + T[:i]):
            return "Yes"
    return "No"

if __name__ == "__main__":
    S = input()
    T = input()
    print(checkStr(S, T))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
T = T + T
index = T.find(S)
if S == -1:
	print("No")
else:
	print("Yes")

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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

if len(a)!=len(b):
  print("No")
else:
    for i in range(len(b)):
        if b==a[i:i+len(b)]:
            print("Yes")
            break
        if i==len(b)-1:
            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 = S[-1] + S[0:-1]
    print(S)
else:
    print('No')

Submission status: Wrong Answer

Solution code:

import sys

moji_S=list(input())
moji_T=list(input())


for i in range(len(moji_S)):
	cut=moji_S[len(moji_S)-1]
	moji_S.pop()
	moji_S.insert(0,cut)
	if moji_S==moji_T:
		print('Yes')
		sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
import sys

moji_S=list(input())
moji_T=list(input())


for i in range(len(moji_S)):
	cut=moji_S.pop()
	moji_S.insert(0,cut)
	if moji_S==moji_T:
		print('Yes')
		sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
import sys

moji_S=list(input())
moji_T=list(input())


for i in range(len(moji_S)):
	cut=moji_S.pop()
	moji_S.insert(0,cut)
	print(moji_S)
	if moji_S==moji_T:
		print('Yes')
		sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
str = input()
str2 = input()

str3 = str2*2

if str3.find(str):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
t2 = t[-1] + t[:-1]
while t2 != t:
  if s == t2:
    print("Yes")
    exit()
  t2 = t2[-1] + t2[:-1]
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
t2 = t[-1] + t[:-1]
while t2 != t:
  if s == t2:
    print("yes")
    exit()
  t2 = t2[-1] + t2[:-1]
print("no")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
t2 = t[-1] + t[:-1]
while t2 != t:
  if s == t2:
    print("yes")
    exit()
  t2 = t2[-1] + t2[:-1]
print("no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = sorted(s)
t = sorted(t)

res = True
for sc, tc in zip(s, t):
    if sc != tc:
        res = False

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

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
com=a
for i in range(len(a)):
  com=com[1:]+com[0]
  if com==b:
    print("yes")
    break
if com!=b:
  print("no")

Submission status: Wrong Answer

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

n = len(a)

ans = False

for i in range(1, n - 1):
    if a[i:n] + a[0:i] == b:
        ans = True
        break

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
'''
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = 0
A.append(A[-1])
for i in range(len(A)-1):
    ans +=A[i]-A[i+1]
print(ans)
'''
S = input()
T = input()
f=0
for i in range(len(S)+1):
    if S == T:
        print('Yes')
        f=1
    S = (S[-1]+S)[:-1]
if f==0:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
'''
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = 0
A.append(A[-1])
for i in range(len(A)-1):
    ans +=A[i]-A[i+1]
print(ans)
'''
S = input()
T = input()
f=0
for i in range(len(S)):
    if S == T:
        print('Yes')
        f=1
    S = (S[-1]+S)[:-1]
if f==0:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#a = int(input())
#b,c = map(int,input().split())
#s = input()
#list_s = list(input())
#list_int = list(map(int,input().split()))

#list = [0 for i in range(n)]
#dp = [[0 for i in range(A)] for j in range(B)]

#list_int 並べて出力 print (' '.join(map(str,ans_li)))
#list_str 並べて出力 print (' '.join(list))

# 2進数 format(10, 'b') # '1010'

# aa=[int(input()) for i in range(n)]

#for i,name in enumerate(list)

''' 二次元配列を一列ずつ
for i in ans:
	print(*i)
'''
''' heapq
queue = []
heapq.heapify(queue) #heapqの作成
heapq.heappush(queue,num) #numのpush(値の追加)
pop = heapq.heappop(queue) #numのpop(最小値の出力)
pop = heapq.heappushpop(queue,num) #push -> pop

'''

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7


S1 = input()
S2 = input()

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

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
n=len(s)
def roate(s):
    return s[i:]+s[:i]
for i in range(n+2):
    if s==t:
        print("Yes")
        exit()
    s=roate(s)
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
n=len(s)
def roate(s):
    return s[i:]+s[:i]
for i in range(n):
    if s==t:
        print("Yes")
        exit()
    s=roate(s)
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
h=0
t=False
while h<len(a):
    if a==b:
        print("YES")
        t=True
        break
    a=a[len(a)-1]+a[:len(a)-1]
    
    h+=1
if t==False:
    print("NO")

Submission status: Wrong Answer

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

Tempo = 0
for i in range(len(S)):
  S = S[-1] + S[:-1]
  if S == T:
      Tempo = Tempo + 1
      print(i)

if Tempo > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from collections import Counter

S = input()
T = input()

S_count = Counter(S)
T_count = Counter(T)

if S_count == T_count:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = False
#tests = s
for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    s = s[-1] + s[0 : len(s) - 1]

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for s_index  in range(len(s)):
    for t_index in range(len(t)):
        flag = True
        index = (s_index + t_index) % len(s)
        if s[s_index] != t[index]:
            flag = False
            continue
    if flag:
        ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    if(s1[i:]+s1[:i-1] == s2):
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
if(S[0:-2]==T[1:-1]):
 
    if(S[-1]==T[0]):
        print('Yes')
    else:
        print('No')
else:
    print('No')