Problem:


Score : 200 points

Problem Statement

You are given string S and T consisting of lowercase English letters.

Determine if S equals T after rotation.

That is, determine if S equals T after the following operation is performed some number of times:

Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.

Here, |X| denotes the length of the string X.

Constraints

2 \leq |S| \leq 100

|S| = |T|

S and T consist of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T

Output

If S equals T after rotation, print Yes; if it does not, print No.

Sample Input 1

kyoto
tokyo

Sample Output 1

Yes

In the first operation, kyoto becomes okyot.

In the second operation, okyot becomes tokyo.

Sample Input 2

abc
arc

Sample Output 2

No

abc does not equal arc after any number of operations.

Sample Input 3

aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Sample Output 3

Yes



Sample input:
kyoto
tokyo


Sample output:
Yes

Submission status: Accepted

Solution code:
import re


s = input()
t = input()

ss = s + s
if re.search(t, ss):
    print('Yes')

else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
a=input()
b=input()
a=a+a
if b in a:
 print("Yes")
else:
 print("No")

Submission status: Accepted

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

isok = False
for i in range(N):
    if S==T:
        isok=True
        break
    S = S[1:]+S[0]
    
if isok: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.readline().rstrip()
T = sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if solve(S, T):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = raw_input()
t = raw_input()
print ["No", "Yes"][ any( t[i:]+t[:i]==s for i in range(len(t)) ) ]

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

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

S = input()
T = input()

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

Submission status: Accepted

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

ans = 'No'

for i in range(len(s)):
    if s == t:
        ans = 'Yes'

    s = s[-1] + s[:-1]

print(ans)

Submission status: Accepted

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

yes = False

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

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

Submission status: Accepted

Solution code:
s = list(input())
t = list(input())
res = False
for i in range(len(s)):
    if t == s[i:] + s[:i]:
        res = True

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

Submission status: Accepted

Solution code:
s = input()
t = input()
#print(s, t)
s += s
#print(s, t)

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

Submission status: Accepted

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

Ss = [S[n:] + S[:n] for n in range(len(S))]

print('Yes' if T in Ss else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = raw_input()
b = raw_input()
n = len(a)
f = 0
for i in xrange(n):
    if a==b:
        f = 1
    a = a[-1:] + a[:-1]
if f==1:
    print 'Yes'
else:
    print 'No'

Submission status: Accepted

Solution code:
import sys

s=input()
t=input()

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

Submission status: Accepted

Solution code:
S = raw_input()
T = raw_input()
N = len(S)

for i in xrange(N + 1):
    if S == T:
        print "Yes"
        exit()
    S = S[1:N] + S[0]
print "No"

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

S = input()
T = input()

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
英小文字からなる文字列S,Tが与えられます。Sを回転させてTに一致させられるか判定してください。
すなわち、以下の操作を任意の回数繰り返してSをTに一致させられるか判定してください。
操作:S=S1S2...S|S|のとき、SをS|S|S1S2...S|S|−1に変更する
ここで、|X|は文字列Xの長さを表します。
"""

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

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

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

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

Submission status: Runtime Error

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

t2 = T + T

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

Submission status: Runtime Error

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

s.sort()
t.sort()

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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 'No' )

Submission status: Runtime Error

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 :'No' else)

Submission status: Runtime Error

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:'No')

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
l = list(map(int,input().split()))
task_list = sorted(l)

print(task_list[2]-task_list[0])

Submission status: Runtime Error

Solution code:
from collections import deque
import sys

deque_s = deque(list(input()))
kyoto
deque_t = deque(list(input()))
tokyo

for _i in range(len(deque_s)):
    deque_s.rotate()
    if deque_s == deque_t:
        print('Yes')
        sys.exit()

print('No')

Submission status: Runtime Error

Solution code:
import sys
S,T = map(str,input().split())
for i in range(len(S)):
  tmp = S[-1]
  S[-1] = ""
  S.insert(0,tmp)
  if S == T:
    print("Yes")
    sys.exit()
print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
from collections import deque
import sys
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))

S = input()
T = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Z =False

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

Submission status: Runtime Error

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

Z =False

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

Submission status: Runtime Error

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: Runtime Error

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

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

for i in range(0,int(len(s)/2)):
  s += s

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

Submission status: Runtime Error

Solution code:
s,t=input().split()
a=0
f=False

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

Submission status: Runtime Error

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

# check
for i in range(len(S)):
    S = S[-1] + S[:-1]

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

print('No')

Submission status: Runtime Error

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('N

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t.pop(0)
  t.append(a)
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = str(input())
n = str(input())
ans = 0
for i in range(len(s)):
    s = s[1:] + s[0]
    if s == n:
        ans = 1
        break-

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

Submission status: Runtime Error

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: Runtime Error

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

for _ in range(len(S)):
    if S == T:
        return True
    else:
        S = S[-1] + S[:-1]

return False

Submission status: Runtime Error

Solution code:
import sys
S1=str(input())
S2=str(input())
NG = False
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    NG = True
    break
if NG:
  print('No')

Submission status: Runtime Error

Solution code:
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    return
print('No')

Submission status: Runtime Error

Solution code:
import sys
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    sys.exit()
print('No')

Submission status: Runtime Error

Solution code:
N = int(input())
print('Yes' if 9 in N else 'No')

Submission status: Runtime Error

Solution code:
import collections deque
S=deque(input())
T=deque(input())
for i in range(len(T)):
  if S==T:
    print("Yes")
    exit()
  t=T.popleft()
  T.appendleft(t)
print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
S,T = map(str,input().split())

import sys

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

Submission status: Runtime Error

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

L = len(S)

bl = False
bl = [True for i in range(L) if S[i:] == T[:L-i] and S[:i] == T[L-i:]:]

answer = 'Yes' if bl else 'No'
print(answer)

Submission status: Runtime Error

Solution code:
s=input()
t=input()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
    if a==len(s):
    	print("NO")
        break
if s==t:
	print("YES")

Submission status: Runtime Error

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

print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#abc103 b
s=input()
t=input()
flag=False
for i in range(n):
    new_t=t[-1]
    new_t+=t[:-1]
    if new_t==s:
        flag=True
        break
    t=new_t

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if S == T:
    print(Yes)
l = len(S)
L = list(S)
for i in range(l):
    a = L[0]
    del L[0]
    L.append(a)
    s = ''.join(L)
    if s == T:
        print('Yes')
        break
else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
for i in range(len(s)):
  check = True:
    for j in range(len(s)):
      if t[j] != s[(i+j)%len(s)]:
        check = False
    if check:
      print("Yes")
      exit()
      
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
N = len(S)
for i in range(N):
    S = S[-1] + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split(" ")))
print(sum(A)-N)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
print(sum(a)-n)

Submission status: Runtime Error

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

x = len(s)

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

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

Submission status: Runtime Error

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

x = len(s)

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

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

Submission status: Runtime Error

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

x = len(s)

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

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
##### 解けた #####

import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False # 一致するかどうかを示すフラグ

for i in range(len(S)):
    Sr=np.roll(S,i) # ロールさせる
    
    if Sr==T: # 一致する場合、フラグを立てて終了
        OKflag=True
        break

if OKflag==True: # 回転させて一致するなら
    print("Yes")
else: # 一致しないなら
    print("No")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()
leng = len(S)
S = sorted(S)
T = sorted(T)
ans = True
for i in range(leng):
    if(S[i] != T[i]):
        ans = False
if(ans):
    print("Yes")
else:
    print"No

Submission status: Runtime Error

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

check = 'No'


for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(A.pop(-1))

print(check)

Submission status: Runtime Error

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

ans = 'Yes'

for i in range(len(A)):
  if A[i] != T[i]:
    ans = "No'
    
print(ans)

Submission status: Runtime Error

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

s = list(S)
ans = 0

if B.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s,t=list(input()),list(input())
n=len(s)
num=0
for j in range(n):
        if s[0]==t[j] and (s[1]==t[j+1] or s[-1]==t[j-1]):
            num=j
ans_t=[]
for i in range(num):
    ans_t.append(s[n-num+i])
for i in range(n-num):
    ans_t.append(s[i])
print('Yes' if t==ans_t or s==t else 'No')

Submission status: Runtime Error

Solution code:
print("Yes" for input() in input()*2 else "No")

Submission status: Runtime Error

Solution code:
S,T=input().split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

Submission status: Runtime Error

Solution code:
S,T=input.split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


def main():
    s = input().strip()
    t = input().strip()
    print('Yes' if any([s[-i:] + s[:-i] == t for i in range(len(s))]) 'No')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
L=list(map(int,input().split()))
L.sort()
a=0
for i in range(len(L)-1):
    a+=L[i]-L[i-1]
    #print(i)
print(a)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import collections

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()
for i in range(len(A)):
　　if A == B:
　　　　print("Yes")
　　　　exit()
　　A = (A+A[0])[1:]
print("No")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
for i in range(len(A)):
　　if(A == B):
　　　　print("Yes")
　　　　exit()
　　A = (A+A[0])[1:]
print("No")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
for i in range(len(A)):
if(A == B):
　　print("Yes")
　　exit()
　　A = (A+A[0])[1:]
print("No")

Submission status: Runtime Error

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
   	print(s)
   	if s == t:
       	break
else:
   	print("no")

Submission status: Runtime Error

Solution code:
from collections import deque
sin = [i for i in input()]
tin = [i for i in input()]
s = deque(sin)
s_origin = s.copy()
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: Runtime Error

Solution code:
from collections import deque
s = deque([i for i in input()])
s_origin = s.copy()
t = deque([i for i in input()])
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: Runtime Error

Solution code:
a = list(map(int,input().split()))
a.sort()
print(abs(a[0]-a[1])+abs(a[1]-a[2]))

Submission status: Runtime Error

Solution code:
N = input()

count = 0

for i in range(len(N)):
    count += int(N[i])
   
if int(N) % count == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S = input()
T = input()
ansCnt = 0
for i in range(len(S)):
    for j in range(1, len(S) + 1):
        if S[-j] == T[-j]:
            continue
        elif j != len(S):
            for z in range(len(S) - j):
                if S[-j] == T[z]:
                    S = S[0:z] + S[-j] + S[z:-j] + S[-j + 1:]
                    continue

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()
ansCnt = 0
for i in range(len(S)):
    for j in range(1, len(S) + 1):
        if S[-j] == T[-j]:
            continue
        elif j != len(S):
            S = S[-j] + S[0: -j] + S[-j + 1:]
            ansCnt += 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

lengt = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s = t:
    c = 0
print('YNeos'[c::2])

Submission status: Runtime Error

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

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        del s[0]
        s = s + tmp
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()
k = t.index(s[0])
t = t[k:]+t[:k]
if s==t:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
object Main extends App {
    def func():Boolean = {
        var s = scala.io.StdIn.readLine()
        val t = scala.io.StdIn.readLine()
        for (_ <- 1 to s.length){
            s = s.tail + s.head
            if (s==t) return true
        }
        return false
    }
    if (func()) println("Yes") else println("No")
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A,B=T.split(S[0],1)

if S[1:]==A+B or S[1:]==B+A:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S0 = input().strip()
S1 = input().strip()
ok = "No"
for i in range(len(S0)):
  if S0 == Si[i:] + S1[:i]:
    ok = "Yes"
print(ok)

Submission status: Runtime Error

Solution code:
s, t = map(str, input().split())
x = len(s)
n = 0
if s == t:
    n = 1
else:
    for i in range(x):
        s = s[-1] + s[:-1]
        if s == t:
            n = 1

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

Submission status: Runtime Error

Solution code:
S,T = map(str,input().split())
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
s = set(input())
t = 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: Runtime Error

Solution code:
import sys
S = list(input())
T = list(input())
for i in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit(0)
    l = S[1:] + list(l[0])
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print("No")