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

Solution (Python):

def main():
    s = list(input())
    t = list(input())


    for i in range(len(t)):
        if t == s:
            print("Yes")
            exit()
        t.insert(0,t.pop())

    print("No")

if __name__ == "__main__":
        main()

Solution (Python):
si = input()
q = input()
si2 = si*2
test = []
for i in range(len(si)):
    test.append(si2[i:i+len(si)])

if q in test:
    print('Yes')
else:
    print('No')

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

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

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

s = len(S)

for i in range(s):
    if( S == T ): break
    S = S[1:] + S[0]

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

Solution (Python):
a = list(input())
b = list(input())
i = 0
for i in range(100):
    if a != b:
        a.append(a[0])
        a.pop(0)
        i += 1
    elif a == b:
        print("Yes")
        break
if a != b:
    print("No")

Solution (Python):
import sys
s=raw_input()
t=raw_input()
l=len(s)
for i in xrange(l):
  u=""
  for j in xrange(l):
    u+=s[(i+j)%l]
  if u == t:
    print "Yes"
    sys.exit()
print "No"

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

if(len(s) != len(t)):
    print("No")
else:
    for i in range(len(s)):
        str = ''.join(s)
        if(str == t):
            print("Yes")
            exit()
        u = s.pop(0)
        s.append(u)
    print('No')

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

Solution (Python):
def main():
        run()

def run():
        word = input()
        word = list(word)
        target = input()
        isSame = False
        for _ in range(len(word)):
                word_string = "".join(word)
                if word_string == target:
                        isSame = True
                        break
                rotate_char = word.pop(0)
                word.append(rotate_char)
        if isSame:
                print("Yes")
        else:
                print("No")

if __name__ == "__main__":
        main()

Solution (Python):








s = input()
t = input()

if(s == t):
    print('Yes')
elif(len(s) != len(t)):
    print('No')
else:
    flag = True
    for i in range(len(s)):
        if(s[i:] + s[:i] == t):
            print('Yes')
            flag = False
            break
    if(flag):
        print('No')

Solution (Python):
S = input()

T = input()

flag = 0


def judge(n):
    i = 0
    while S[i] == T[(i+n) % len(S)] :

        i += 1
        if i == len(S):
            print("Yes")
            return 1
            break
    return 0

for i in range(len(S)):
    j = judge(i)
    if j == 1:
        break

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

Solution (Python):
import sys
S = input()
T = input()

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

Solution (Python):
S = list(input())
T = list(input())
result = ""
for i in range(len(T)):
  S.insert(0, S[-1])
  S = S[:-1]
  if S == T :
    result = "Yes"
    break
  else :
    result = "No"
print(result)

Solution (Python):
S = list(input())
T = list(input())
result = 0
n = 0
N = len(S)

while result == 0 and n < N:
    if S == T:
        result = 1
    else:
        S = S[1:N] + [S[0]]
        n += 1
        
if result == 0:
    print('No')
else:
    print('Yes')

Solution (Python):



S = list(input())
T = list(input())
Flag=0
for i in range(len(S)):
    K=[]
    L = S[0:len(S)-(i+1)]
    K = S[len(S)-i-1:]
    K = K+L
    
    if (K)==T:
        print("Yes")
        Flag=1
        break;
if Flag==0:
    print("No")

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

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

Solution (Python):
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Solution (Python):


s1 = input()
s2 = input()
f = 0

for i in range(len(s1)):
    s = s1[i:len(s1)] + s1[0:i]
    if s == s2:
        f = 1
        break
if f == 1:
    print("Yes")
elif f == 0:
    print("No")

Solution (Python):

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

Solution (Python):
import sys

a = input()
b = input()

for i in range(len(a)):
    temp = a[:1]
    a = a[1:]
    a = a+temp
    if a == b:
        print("Yes")
        sys.exit()

print("No")

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

for i in range(len(s)):
    s_ = s[1:] + s[0]

    if s_ == t:
        print('Yes')
        exit()

    s = s_

print('No')

Solution (Python):
a=input()
b=input()
for i in range(0,len(a)):
  if a==b[i:]+b[:i] : 
    print("Yes")
    exit(0)
print("No")

Solution (Python):
import sys

s = input()
t = input()

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

Solution (Python):
a=input()
b=input()
z=len(a)
for i in range(0,z):
  if a==b[i:]+b[:i] : 
    print("Yes")
    exit(0)
print("No")

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

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


flag = False
for i in range(len(a) + 1):
    if a == b:
        flag = True
        break
    else:
        p =  b[0]
        b.pop(0)
        b.append(p)

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

Solution (Python):
import sys

S = input()
T = input()

Sc = list(S)
Tc = list(T)

Sl = len(Sc)
newSc = Sc

for i in range(Sl):
    newSc = newSc[(Sl - 1):] + newSc[:(Sl - 1)]
    if Tc == newSc:
        print('Yes')
        sys.exit()

print('No')

Solution (Python):
def main():
    S = input()
    T = input()
    for i in range(len(S)):
        Ti = T[i:] + T[:i]
        if Ti == S:
            print("Yes")
            return
    print("No")


if __name__ == '__main__':
    main()

Solution (Python):
a=list(input())
b=list(input())

n=len(a)
f=-1

for i in range(n):
    for k in range(n):
        if not a[k]==b[k]:
            break
    else:
        f=1
        break
    if f<0:
        tmp=['0']*n
        tmp[0]=b[n-1]
        for j in range(1,n):
            tmp[j]=b[j-1]
        for k in range(n):
            b[k]=tmp[k]

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

Solution (Python):
ins1 = input()
ins2 = input()
length = len(ins1)
ans = False
for i in range(0,length):
	ins1=ins1[length-1]+ins1
	if ins1[0:length] == ins2 :
		ans = True
if ans:
	print("Yes")
else:
	print("No")

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

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

ans=False

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

Solution (Python):
s = input()
t = input()
s_li = list(s)
t_li = list(t)

if not len(s_li) == len(t_li) :
    print("No")
    exit()

buf = s_li

for i in range(len(s_li)):
    s_join = "".join(s_li)
    buf = []
    if t == s_join:
        print("Yes")
        exit()
    for j in range(len(s_li)):
        if j == 0 :
            buf.append(s_li[len(s_li) - 1])
        else :
            buf.append(s_li[j - 1])
    s_li = buf

print("No")

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

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

    else:
        print('Yes')
        break

else:
    print('No')

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

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

print(ans)

Solution (Python):
def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
    else:
        print("No")

Solution (Python):
import sys
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    S = read_func().strip()
    T = read_func().strip()

    for i in range(len(T)):
        is_match = True
        for j in range(len(S)):
            if S[j] != T[(i + j) % len(T)]:
                is_match = False
                break
        if is_match == True:
            break;
    if is_match == True:
        print "Yes"
    else:
        print "No"

if __name__ == '__main__':
    main()

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

Solution (Python):



n = input()
m = input()

d = {}

flag = False

for i in range(len(n)):
    if n[i:]+n[:i] == m:
        flag = True

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

Solution (Python):
inp = raw_input()
test = raw_input()

inp2 = inp * 2

if test in inp2:
    print 'Yes'
else:
    print 'No'

Solution (Python):
s = list(input())
l = list(input())
num = len(s)

for i in range(num):
    if s == l:
        print("Yes")
        exit()
    tmp = s[1:]
    tmp.append(s[0])
    s = tmp
print("No")

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

ary_s = []
ary_t = []

for i in s:
    ary_s.append(i)
for i in t:
    ary_t.append(i)

copy = list(ary_s)

if ary_s == ary_t:
    print("Yes")
else:
    while(True):
        tmp = ary_s[-1]
        ary_s.insert(0,tmp)
        ary_s.pop(-1)
        if ary_s == ary_t:
            print("Yes")
            break
        if ary_s == copy:
            print("No")
            break

Solution (Python):

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

Solution (Python):


s = str(input())
t = str(input())

a=int(1)

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

if a==1:
    print('No')

Solution (Python):
def main():
    s = input()
    t = input()
    check (s,t)


def check(s,t):
    ns = len(s)
    nt = len(t)
    bool = 0

    if ns != nt:
        pass
    else:
        for i in range(ns):
            st = t[i:] + t[:i]
            if s == st:
                bool = 1
            else:
                pass

    if bool == 1:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Solution (Python):


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

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

print('No')

Solution (Python):
def get_score(s, t):
    for i in range(len(s)):
        s = s[-1:] + s[:len(s) - 1]
        if s == t:
            return True
    return False


a = input()
b = input()

r = 'Yes' if get_score(a, b) else 'No'
print(r)

Solution (Python):
s = input()
t = input()
n = len(s)

flag = 0
for i in range(n):
    if s==t: flag = 1; break
    s = s[n-1]+s[:n-1]

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

Solution (Python):
a=input()
b=input()
b=list(b)
n=len(a)
flag=0
for i in range(0,n):
    a=list(a)
    c=a[n-1]
    a=a[0:n-1]
    a.insert(0,c)
    
    
    if a==b:
        flag=1
        break
if flag==0:
    print('No')
else:
    print("Yes")

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

if (S + S).find(T) != -1:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys

s = input()
t = input()

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

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

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

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

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

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

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

Solution (Python):
S=raw_input()
T=raw_input()
SS=S+S
if T in SS:
  print 'Yes'
else:
  print 'No'

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

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

is_equal = False

for i in range(len(s)):
    s = s[1:] + s[0]
    if s == t:
        is_equal = True
        break

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

Solution (Python):
def main():
    s = raw_input()
    t = raw_input()

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

Solution (Python):
S = input()
T = input()
lst = []
num = len(S)
for i in range(num):
    R = S[0:i]
    Q = S[i:num]
    U = Q + R
    lst.append(U)
ans = lst.count(T)
if ans == 0:
    print("No")
else:
    print("Yes")

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

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

else:
	ans="No"

print(ans)

Solution (Python):
candidate = []
S = input()
T = input()
L = list(S)
for i in range(len(S)) :
    a = L[0]
    L.pop(0)
    L.append(a)
    b = ''.join(L)
    candidate.append(b)

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

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

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

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

Solution (Python):
s = input()
t = input()
flg = False
x = len(s)
for i in range(x):
  k = s[i:] + s[:i]
  if(k == t):
    flg = True
    break
if(flg):
  print("Yes")
else:
  print("No")

Solution (Python):

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

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

Solution (Python):


S = input()
T = input()

T_list = list(T)
ans = 'No'
S_trans = list(S)
for i in range(len(S)):
    S_trans = list(S_trans[-1]) + list(S_trans[0:-1])
    if S_trans == T_list:
        ans = 'Yes'
        break

print(ans)

Solution (Python):
S = list(str(input()))
T = list(str(input()))
listS = list(range(len(S)-1))
for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        lastS = S[len(S)-1] 
        for j in listS[::-1]:
            S[j+1] = S[j]
        S[0] = lastS
        if i == len(S)-1:
            print('No')

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

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

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

Solution (Python):
import numpy
s = input()
t = input()
ti = [i for i in range(len(t))]

flg = False
for i in range(len(s)):
    tmp = [t[i] for i in numpy.roll(ti, i)]
    if s == "".join(tmp):
        flg = True
        break
    
if flg:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

s = input()
t = input()

sLen = len(s)

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

print("No")

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

Solution (Python):
import sys
s = input()
t = input()
templist = list(s)


for i in range(len(s)):
    
    if "".join(templist)==t:
        print("Yes")
        sys.exit()
    else:
        temp = templist[-1]
        
        templist.insert(0, temp)
        
        templist.pop(-1)
print("No")

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

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

Solution (Python):
import sys

s = input()
t = input()

def check(i):
	ns = s[i:] + s[:i]
	if ns == t:
		print('Yes')
		sys.exit()
	else:
		return

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

Solution (Python):
S_raw = input()
T_raw = input()

S_copy = S_raw
T_copy = T_raw

flag_end = False


while S_copy != '':
    str_tmp = S_copy[0]
    if S_copy.count(str_tmp) != T_copy.count(str_tmp):
        print('No')
        flag_end = True
        break
    S_copy = S_copy.replace(str_tmp, '')
    T_copy = T_copy.replace(str_tmp, '')


if flag_end == False:
    for i in range(0, len(S_raw)):
        if S_raw[i:] in T_raw:
            if S_raw[i:]+S_raw[:i] == T_raw:
                print('Yes')
                flag_end = True
                break

if flag_end == False:
    print('No')

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

flag = 0

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

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

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

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

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

Solution (Python):


s = input()
t = input()

isok=0

for _ in range(len(s)):
    s = s[1:]+s[0]
    if s == t:
        isok=1
        break

if isok == 1:
    print('Yes')
else:
    print('No')

Solution (Python):
S = list(input())
T = list(input())
ans = "No"
for i in range(len(S)):
	if S == T:
		ans = "Yes"
		break
	S.insert(0,S[-1])
	S.pop(-1)
print(ans)

Solution (Python):
S = raw_input()
T = raw_input()

T_d = T + T
if S in T_d:
    print 'Yes'
else:
    print 'No'

Solution (Python):
S = list(input())
T = list(input())
ans = "No"
for x in range(len(S)):
    Stel = S[-1]
    del S[-1]
    S.insert(0, Stel)
    if S == T:
        ans = "Yes"
        break
print(ans)

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

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

Solution (Python):
turn=str(input())
corrected=str(input())
correct=False
count=0
while(True):
    count=count+1
    if(turn==corrected):
        print('Yes')
        break
    else:
        last=turn[len(turn)-1]
        turn=turn[0:len(turn)-1]
        turn=last+turn
    if(count>100):
        print('No')
        break

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


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

Solution (Python):
a = input()
b = input()
 
if (len(a) != len(b)):
  print("No")
  exit(0)
for i in range(len(a)):
  if a[i:] + a[:i] == b:
    print("Yes")
    exit(0)
print("No")

Solution (Python):
s = input()
t = input()
s2 = s + s
if t in s2:
	print('Yes')
else:
	print('No')

Solution (Python):
a = input()
b = input()
 
if (len(a) != len(b)):
  print("No")
  exit(0)
for i in range(len(a)):
  if a[i:] + a[:i] == b:
    print("Yes")
    exit(0)
print("No")

Solution (Python):


s = raw_input()
t = raw_input()
lens = len(s)
if lens != len(t):
    print 'No'
    exit(0)
elif s == t:
    print 'Yes'
    exit(0)
else:
    for i in range(1, lens):
        if s[i:] + s[:i] == t:
            print 'Yes'
            exit(0)
print 'No'

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

count = 0

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

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

is_rotated = False

for i in range(len(s)):
  s.insert(0, s[-1])
  del s[-1]

  if s == t:
    is_rotated = True
    break

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

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

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

print('No')

Solution (Python):



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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

w1 = sys.stdin.readline().strip()
w2 = sys.stdin.readline().strip()

for i in range(len(w1)):
    if w1 == w2:
        sys.stdout.write("Yes")
        exit(0)
    w1 = w1[1:] + w1[0]

sys.stdout.write("No")

Solution (Python):
S = list(input())
T = list(input())
Ans = False

for i in range(len(S)):
    S.insert(0,S[-1])
    S.pop(-1)
    if S == T:
        Ans = True
        break

if Ans == True:
    print('Yes')
else:
    print('No')

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

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

len_ST = len(S)

for i in range(len_ST):
    S = S[len_ST - 1] + S[:len_ST - 1]

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

print("No")

Solution (Python):
import sys
s, t = [ sys.stdin.readline().rstrip()
         for _ in range(2) ]
n = len(s)
yes = False
for i in range(n):
    if s[i] == t[0] and s[i:] + s[:i] == t:
        yes = True
        break
print("Yes" if yes else "No")

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

l = len(s)  

if any([((s[i:l] + s[0:i]) == t) for i in range(l)]):
    print('Yes')
else:
    print('No')

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


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

Solution (Python):
s=str(input())
t=str(input())
a=len(s)
flag=0
for i in range(a):
    t=t[a-1:]+t
    t=t[:-1]
    if t==s:
        flag=1
        break
    else:
        pass
if flag==1:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
s=input()
t=input()
for i in range(len(s)):
    a=s[:i]
    b=s[i:]
    if t.startswith(b) and t.endswith(a):
        print("Yes")
        sys.exit()
print("No")

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

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

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

Solution (Python):
import sys
s = sys.stdin.readline().strip()
t = sys.stdin.readline().strip()
ok = 0
for i in range (len (s)):
  if t == s[i:] + s[:i]:
    ok = 1
print (["No", "Yes"][ok])

Solution (Python):

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

flag = 0
for i in range(0, len(S)):
    tmp = T[0]
    T.pop(0)
    T.append(tmp)
    if S == T :
        flag = 1

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

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

Solution (Python):


if __name__ == '__main__':
    S = input()
    T = input()
    S_ = S
    for i in range(len(S)):
        if S_ == T:
            print("Yes")
            exit()
        tmp = S_[0]
        S_ = S_[1:] + tmp
    print("No")

Solution (Python):
S=input()
listS=[]
for i in range(len(S)):
    listS.append(S[i])

T=input()
listT=[]
for j in range(len(T)):
    listT.append(T[j])

if len(listS)!=len(listT):
    print("No")
else:
    count=0
    for k in range(len(S)):
        listS.insert(0,listS[len(S)-1])
        del listS[len(S)]
        if listS==listT:
            print("Yes")
            break
        else:
            count+=1
    if count==len(S):        
        print("No")

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

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

print('No')

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

ans  ="No"

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

print(ans)

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

ans = 'No'

for _ in range(len(s)):
    last = s[-1]
    s = last + s[:-1]
    if s == t:
        ans = 'Yes'
        break

print(ans)

Solution (Python):



s = raw_input()
t = raw_input()

isOk=False
for i in range(len(s)):
	c=''.join(list(s)[i:]+list(s)[:i])
	if t == c:
		print 'Yes'
		isOk=True
		break

if not isOk:
	print 'No'

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

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

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

flag = False
s_tmp = S
for cnt in range(len(S)):
    s_tmp = s_tmp[-1] + s_tmp[:-1]
    if s_tmp == T:
        flag = True
        break

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

Solution (Python):
a = []
a += input()
a *= 2
b = []
b += input()
k = 0
for i in range(len(b)):
    t = []
    for j in range(i, i + len(b)):
        t += a[j]
    if t == b:
        print("Yes")
        k = 1
        break
if k == 0:
    print("No")

Solution (Python):

def solve():
    S = input()
    T = input()
    b = any([T == (S[i:]+S[:i]) for i in range(len(S))])
    a = 'Yes' if b else 'No'
    return str(a)

if __name__ == '__main__':
    print(solve())

Solution (Python):
S=input()
T=input()
flag=0
for i in range(len(S)):
    S_rotation=S[i:]+S[:i]
    if S_rotation==T:
        print('Yes')
        flag=1
        break
if flag==0:
    print('No')

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


reg = S
flag=False
for i in range(len(S)):
    if reg == T:
        print('Yes')
        flag=True
        break
    else:    
        reg=reg[-1]+reg[0:len(S)-1]
        
if not flag: 
    print('No')

Solution (Python):
S = list(str(input()))
T = list(str(input()))

cc = 0
for i in range(len(S)):
  if S == T:
    cc += 1
    break
  else:
    S.insert(0,S[-1])
    S.pop()
    
if cc == 1:
  print("Yes")
else:
  print("No")

Solution (Python):
from collections import deque


def rotate(string, n):
    string = deque(string)
    string.rotate(n)
    return "".join(string)


def solve(s, t):
    for i in xrange(len(s)):
        if rotate(t, i) == s:
            return 'Yes'

    return 'No'


s = raw_input()
t = raw_input()
print solve(s, t)

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

s2=""
f=0
l=len(s)
for i in range(0, len(s)):
    s2+=s[i:l]
    s2+=s[0:i]
    if s2==t:
        f=1
    else:
        s2=""


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

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

ans = 0

for i in range(len(s)):
    if s == t:
        ans = 1
    else:
        b = s[1:]
        b += s[0]
        s = b

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

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

def r(s, i):
    return s[-i:] + s[:-i]

for i in range(len(S)):
    if T in r(S, i):
        print("Yes")
        break
else:
    print("No")

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

s = set([s for s in S])
t = set([t for t in T])

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

Solution (Python):
n=input()
m=input()
l=''
answer='No'
for i in range (len(n)):
    if n==m:
        answer='Yes'
        break
    m=m[1:]+m[:1]
print(answer)

Solution (Python):

  
S = input()
T = input()

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

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

print('No')

Solution (Python):

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

Solution (Python):
S = input()
T = input()
N = len(S)
judge = "No"
for i in range(N):
	s = S[i:] + S[:i]
	if s == T:
		judge = "Yes"
		break

print(judge)

Solution (Python):

s = input()
t = input()

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

else:
    print('No')

Solution (Python):




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

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

    else:
        print("No")


if __name__ == '__main__':
    main()

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

n = len(s)
ans = "No"
for i in range(n):
    cnt = 0
    for j in range(n):
        if s[j] == t[(i + j) % n]:
            cnt += 1
    if cnt == n:
        ans = "Yes"
        break
print(ans)