Problem:
Ring Write a program which finds a pattern $p$ in a ring shaped text $s$.   Input In the first line, the text $s$ is given. In the second line, the pattern $p$ is given. Output If $p$ is in $s$, print Yes in a line, otherwise No . Constraints  $1 \leq $ length of $p \leq $ length of $s \leq 100$  $s$ and $p$ consists of lower-case letters  Sample Input 1 vanceknowledgetoad
advance Sample Output 1 Yes Sample Input 2 vanceknowledgetoad
advanced Sample Output 2 No

Solution (Python):
r = input().strip()
s = input().strip()

if s in r+r:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    
    s=input()
    p=input()
    if len(p)>len(s):
        print("No")
        exit()
    if p in s*2:
        print("Yes")
    else:
        print("No")

main()

Solution (Python):
a = input()
a *= 2
b = input()
if b in a:
    print("Yes")
else:
    print("No")

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

p = p + p
flag = False
for i in range(len(p)):
    for j in range(i, len(p)):
        if p[i:j] == s:
            flag =True

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

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

sx = s * 2
if p in sx:
    print("Yes")
else:
    print("No")

Solution (Python):
a = 0

s = input()
sw = s+s

t = input()

l = [0 for i in range(len(t))]

for i in range(len(s)):
 if s[i] == t[0]:
  for j in range(len(t)):
   l[j] = sw[i+j]
  m = "".join(map(str, l)) 
  if m == t:
    print("Yes")
    a += 1
    break
if a == 0:
  print("No")

Solution (Python):
s, p = input(), input()

ans = 'Yes' if p in s + s else 'No'

print(ans)

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

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

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

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

s += s
if s.find(p) == -1:
    print('No')
else:
    print('Yes')

Solution (Python):
word = input()
key = input()
wordcircle = word + word
bool = False

for i in range(0, len(wordcircle)-len(key)+1):
    if wordcircle[i:i+len(key)]==key:
        bool = True

if bool == True:
    print("Yes")
else:
    print("No")

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

s = s + s
s_arr = list(s)
p_arr = list(p)
i = 0
j = 0
flag = False
while i < len(s_arr) :
	if flag : break
	ii = i
	while (s_arr[ii] == p_arr[j]) :
		ii += 1
		j += 1
		if (j == len(p_arr)) :
			flag = True
			break
		if (ii >= len(s_arr)):
			break
	j = 0
	i += 1

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

Solution (Python):
s=input()
q=input()
res=0
if q in s:
    res=1
else:
    for i in range(len(s)):
        if q in s[i:len(s)]+s[:i]:
            res=1
if res==1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
s += s
if input() in s:
    print("Yes")
else:
    print("No")

Solution (Python):
txt=input()
txt+=txt[:len(txt)-1]
pat=input()
if pat in txt:
    print('Yes')
else:
    print('No')

Solution (Python):
s, p= input(), input()
print('Yes') if p in (s + s[:len(p)]) else print('No')

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

s = s + s[:-1]

if s.find(p)!= -1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
ss = s+s

found=False
for i in range(0,len(s)):
    if (ss[i:i+len(p)] == p):
        found=True
        break

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

Solution (Python):
s = str(input())
p = str(input())
s = s*2
num = 0
for i in range(len(s)):
    if s[i:i+len(p)] == p:
        num += 1
if num >= 1:
    print("Yes")
else :
    print("No")

Solution (Python):
s = input()
p = input()
s *= 100

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

print('No')

Solution (Python):
s=input()
s+=s
p=input()

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

Solution (Python):
s = input()
p = input()
s *= 2
if s.find(p) >= 0:
    print("Yes")
else:
    print("No")

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

if ( p in s * 2):
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
p = input()
can_make = False
for i in range(len(s)):
    ss = ""
    if i+len(p) > len(s):
        ss = s[i:] + s[0:(i+len(p))-len(s)]
    else:
        ss = s[i:i+len(p)]
    if ss == p:
        can_make = True
        break
if can_make:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
ring = s * 100
if p in ring:
    print("Yes")
else:
    print("No")

Solution (Python):
sen1=input()
sen2=input()

possible_start=[]

for i in range(len(sen1)):
    if sen2[0]==sen1[i]:
        possible_start.append(i)

if len(possible_start)==0:
    print("No")

for i in range(len(possible_start)):
    sen1_new=sen1[possible_start[i]:]+sen1[:possible_start[i]]
    if sen2 in sen1_new:
        print("Yes")
        break
    else:
        if i==len(possible_start)-1:
            print("No")

Solution (Python):
s=input()
p=input()
s+=s
if p in s:
    print("Yes")
else:
    print("No")

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

Solution (Python):
def is_contain(circle, target, index):
    for char in target:
        if char == circle[index]:
            index += 1
            if index == len(circle): index = 0
            continue
        else:
            return False
    return True


circle = input()
target = input()

index = 0

while True:
    try:
        index = circle.index(target[0], index)
        if is_contain(circle, target, index):
            print('Yes')
            break
        index += 1
    except ValueError:
        print('No')
        break

Solution (Python):
p = input()
q = p * 2
s = input()
if s in q:
    print("Yes")
else:
    print("No")

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

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

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

if p in (s*2):
    print('Yes')
else:
    print('No')

Solution (Python):
import re

s = input()
p = input()
text = s + s


if re.search(p, text):
    print('Yes')
else:
    print('No')

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

s = s * 2

if p in s:
    print('Yes')
else:
    print('No')

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

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

s_l = len(s)
p_l = len(p)

s_j = ((p_l // s_l) + 2) * s

if p in s_j:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s = input()
p = input()
tmp = s * 2

if not tmp.find(p) == -1:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s = input()
p = input()
isYes = False

for start in range(0, len(s)):
    if s[start] == p[0]:
        i = start
        j = 0
        while j < len(p):
            if s[i] != p[j]:
                break
            i += 1
            if i == len(s):
                i = 0
            j += 1
        else:
            print("Yes")
            exit(0)
if not isYes:
    print("No")

Solution (Python):
s = input()
p = input()
s = s+s
print("Yes" if p in s else "No")

Solution (Python):

import os,re,sys,operator,math,heapq,string



from sys import stdin,setrecursionlimit


setrecursionlimit(10**6)
input=stdin.readline

s=input().rstrip()
t=input().rstrip()
print("Yes" if t in s+s else "No")

Solution (Python):
s = input()
s = s + s
p=input()
if p in s:
    print("Yes")
else:
    print("No")

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

ss = s + s

if ss.find(p) < 0:
    print("No")
else:
    print("Yes")

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

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

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

Solution (Python):
s=input()
p=input()
a=(s+s)
if p in a:
	print("Yes")
else:
	print("No")

Solution (Python):
s=input()
p=input()
w=(s+s)
if p in w:
	print("Yes")
else:
	print("No")

Solution (Python):
def test():

	s_original = input()
	s_string = list(s_original+s_original)
	p_string = list(input())

	for i in range(len(s_string) - len(p_string)):
		
		comp_progress = 0

		for j in range(len(p_string)):
			
			if p_string[comp_progress] == s_string[i+j]:
				comp_progress += 1
			else:
				break
			
		if comp_progress == len(p_string):
			break
	
	if comp_progress == len(p_string):
		print("Yes")
	else:
		print("No")

if __name__ == "__main__":
	test()

Solution (Python):


s = input()
p = input()
x = s + s
if p in x:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input() * 2
p = input()

if p in s:
    print('Yes')
else:
    print('No')

Solution (Python):
r = input()
p = input()
r_twice = r*2
if p in r_twice :
	print("Yes")
else:
	print("No")

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

if (s+s).find(p) > -1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
s += s
p = input()

if p in s:
    print('Yes')
else:
    print('No')

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

Solution (Python):
I=input;s=I()*2;print(['No','Yes'][I()in s])

Solution (Python):

s = input()
p = input()
 
s += s[:len(p)]
if p in s:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s=input();print(['No','Yes'][input()in s*2])

Solution (Python):
import sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
S = str(input())
P = str(input())
 
is_ok = False
 
for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break
 
    if FLG == True:
        is_ok = True
        break
 
if is_ok == True:
    print("Yes")
else:
    print("No")

Solution (Python):
a=input()
b=input()
a=a+a[:-1]
if a.find(b)!=-1:
        print("Yes")
else:
        print("No")

Solution (Python):
s = input()
p = input()
s = s + s[:len(p)]
if p in s:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
p=input()
ss=s+s
if ss.find(p)==-1:
  print("No")
else:
  print("Yes")

Solution (Python):
s = input()
s += s
p = input()
 
print("Yes" if p in s else "No")

Solution (Python):
r = []
ring = list(str(input()) * 2)
ch = str(input())
for i in range(int(len(ring) / 2)):
    if ring[i : i + len(list(ch))] == list(ch):
        r.append("1")
if len(r) >= 1:
    print("Yes")
else:
    print("No")

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

if P in (S + S):
	print("Yes")
else:
	print("No")

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


bl = False
for i in range(len(s)):
    
    for j in range(len(p)):
        if s[(i+j)%len(s)] !=p[j]:
            break
    if(j==len(p)-1 and s[(i+j)%len(s)] ==p[j]):
        bl = True
        break
if bl:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
p = input()
len_s = len(s)
len_p = len(p)
ans = "No"
for i in range(len_s):
    match_count = 0
    for j in range(len_p):
        k = (i + j) % len_s
        if s[k] == p[j]:
            match_count += 1
        else:
            break
    if match_count == len_p:
        ans = "Yes"
        break
print(ans)

Solution (Python):
s = input()
p = input()
s = s + s
if p in s:
  print("Yes")
else:
  print("No")

Solution (Python):


s = input()
t = input()
s += s
ans = "No"
for i in range(len(s)//2):
    if s[i] == t[0]:
        for j in range(len(t)):
            if s[i+j] != t[j]:
                break
            elif j == len(t)-1:
                ans = "Yes"
print(ans)

Solution (Python):
A= input().lower()
text_input=A+A[:-1]
text_find = input().lower()

if text_input.find(text_find)!=-1:
  print("Yes")
else:
  print("No")

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

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

Solution (Python):
string=input()
serch=input()
new_string=string*2
answer=0
for s in range(len(new_string)):
    if new_string[s]==serch[0]:
        if new_string[s:s+len(serch)]==serch:
            answer+=1
if answer>0:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
s += s[:-1]
if p in s:
  print("Yes")
else:
  print("No")

Solution (Python):

import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


S = str(input())
P = str(input())

is_ok = False

for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break

    if FLG == True:
        is_ok = True
        break

if is_ok == True:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
 
s += s
 
if s.count(p):
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
s=s+s
p=input()
if s.count(p)>0:
    print("Yes")
else:
    print("No")

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

print('Yes' if p in s*2 else 'No')

Solution (Python):
a=input()
b=input()
a=a+a[:-1]
if a.find(b)!=-1:
        print("Yes")
else:
        print("No")

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

Solution (Python):
string = input()
 
string *= 3 
 
if string.find(input()) != -1: 
    print("Yes")
else:
    print("No")

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

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

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

if p in (s + s):
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
S = str(input())
P = str(input())
 
is_ok = False
 
for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break
 
    if FLG == True:
        is_ok = True
        break
 
if is_ok == True:
    print("Yes")
else:
    print("No")

Solution (Python):

try:
    while True:
        str=input()
        word=input()
        str+=str
        str+=str
except EOFError:
    pass
if word in str:
    print('Yes',end='')
else:
    print('No',end='')
print()

Solution (Python):
s = input()
p = input()
s += s
print("Yes") if p in s else print("No")

Solution (Python):
if __name__ == "__main__":
    input_str = input()
    pattern = input()
    input_str = input_str + input_str
    if pattern in input_str:
        print("Yes")
    else:
        print("No")

Solution (Python):
import sys

s = list(input())  
p = input()
for i in range(len(s)):
    j = i
    c = 0
    x = ""
    while c < len(p):
        if j == len(s):
            j = 0
        x += s[j]
        j += 1
        c += 1
    if p == x:
        print("Yes")
        sys.exit()
print("No")

Solution (Python):

s=input()
p=input()
s=s+s
if p in s:
  print("Yes")
else:
  print("No")

Solution (Python):






import sys


class mymath:
    
    pi = 3.14159265358979323846264338

    
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()


class output:
    
    def list(self, l):
        l = list(l)
        
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()






















def get_input():
    N = []
    while True:
        try:
            N.append(input())
        except EOFError:
            break
    return N

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

    S = S + S[:len(P)]

    if S.find(P) == -1:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
s += s
p = input()

print("Yes" if p in s else "No")

Solution (Python):
I1 = str(input())
I2 = str(input())

I = (I1)*2
if I2 in I:
  print('Yes')
else:
  print('No')

Solution (Python):
I = input()
s = I*2

P = input()

if P in s :
  print('Yes')
else :
  print('No')

Solution (Python):
str1 = input()
s = list(str1)
str2 = input()
p = list(str2)

for i in range(len(s)):
    count = 0
    for j in range(len(p)):
        
        if s[(i+j)%len(s)] != p[j]:
            break
        else:
            count = count + 1
    if count == len(p):
        print('Yes')
        
        break

if count != len(p):
    print('No')

Solution (Python):
s=input()
p=input()
s+=s[:-1]
print("Yes"if p in s else "No")

Solution (Python):
array_s=[]
result=[]
flg=0

text_s=input()

text_p=input()


array_s=list(text_s)




end=len(array_s)
new=""


for k in range(0,end):

    for i in range(k,end):
        new=new+array_s[i]
    for j in range(0,k):
        new=new+array_s[j]
    result.append(new)
    new=''

for i in result:
    if text_p in i:
        flg=1
    else:
        pass

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

Solution (Python):
s = input()
p = input()
"""
num = len(p)
print(num)

a = 0
for i in s:
  for j in p:
    if i == j:
      a+=1
"""

      
if p in s*2:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
    
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
    
    
S = str(input())
P = str(input())
    
is_ok = False
    
for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break
    
    if FLG == True:
        is_ok = True
        break
    
if is_ok == True:
    print("Yes")
else:
    print("No")

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

s +=s

if s.count(p):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
   
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
   
   
S = str(input())
P = str(input())
   
is_ok = False
   
for i in range(len(S)):
    FLG = True
    for k in range(len(P)):
        if S[(i+k)%(len(S))] != P[k]:
            FLG = False
            break
   
    if FLG == True:
        is_ok = True
        break
   
if is_ok == True:
    print("Yes")
else:
    print("No")

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

ss= s+s



if ss.find(p)>=0:
	print("Yes")
else:
	print("No")

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

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

Solution (Python):
flag = 0
str1 = input()
str2 = input()
str1 *= 2
for i in range(len(str1)):
    if str1[i:i+len(str2)] == str2:
        flag=1
        break
if flag==1:
    print("Yes")
else:
    print("No")

Solution (Python):

s = input()
p = input()

s=s+s[:-1] 
if s.find(p)!=-1:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
s = input()
p = input()
s = s + s
if p in s:
    print("Yes")
else :
    print("No")

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

ls=len(s)
lp=len(p)

for i in range(ls):
    if i+lp<=ls:
        
        j=i+lp
        check=s[i:j]
    else:
        check1=s[i:ls]
        check2=s[0:i+lp-ls]
        check=check1+check2
        
        
        
    if check==p:
        print("Yes")
        break
    elif i==ls-1:
        print("No")

Solution (Python):
s=input()*2
n=len(s)//2
t=input()
c=0
for i in range(n):
    if t in s[i:i+n]:
        print("Yes")
        exit()
print("No")

Solution (Python):
s = input()*2
p = input()

if p in s:
  print('Yes')
else:
  print('No')

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

if p in s * 2:
    print("Yes")
else:
    print("No")

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

s *= 2
if p in s:
    print('Yes')
else:
    print('No')

Solution (Python):

s = input()
p = input()

if p in s*2:
    print("Yes")
else:
    print("No")

Solution (Python):
def eval_ring_text(text, target):
    return target in (text * 2)



if __name__ == "__main__":
    text = input()
    target = input()



    if eval_ring_text(text, target):
        print("Yes")
    else:
        print("No")

Solution (Python):
text = input()
sx   = input()

text = text + text
text.lstrip()
text.rstrip()
index = text.find(sx)
if index != -1:
    print("Yes")
else:
    print("No")

Solution (Python):
def get_substr(i, l, s):
    j = (i + l) % len(s)
    if j > i:
        return s[i:j]
    else:
        return s[i:] + s[:j]


s = input()
p = input()

for i in range(len(s)):
    if get_substr(i, len(p), s) == p:
        print('Yes')
        break
else:
    print('No')

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

str = s * 2
if p in str:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
if __name__ == '__main__':
	data = str(input()) * 2
	pattern = str(input())
	try:
		data.index(pattern)
		print("Yes")
	except:
		print("No")

Solution (Python):
s = input()
p = input()
s = s + s
if p in s:
  print("Yes")
else:
  print("No")

Solution (Python):
ring = input()
s = ring * 2
p = input()
if s.find(p) == -1:
    print("No")
else:
    print("Yes")

Solution (Python):
x = input()
y = input()
x *= 2
if y in x:
     print('Yes')
else:
    print('No')

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

Solution (Python):
if __name__ == '__main__':
    s = input()
    p = input()
    ss = s * 2
    flag = False
    for i in range(len(ss) - len(p)):
        if ss[i:i+len(p)] == p:
            flag = True
            break
    print("Yes" if flag else "No")

Solution (Python):
x = input()
y = input()
z = x * 100

if z.find(y) >= 0:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
text = input()
judge_string = input()
for i in range(len(text)):
    if judge_string in text:
        print('Yes')
        break
    else :
        text = list(text)
        pop_text = text.pop()
        text.insert(0, pop_text)
        text = ''.join(text)
        if i == len(text) - 1:
            print('No')

Solution (Python):
s = input()
p = input()
s = s*2

if p in s:
    print('Yes')
else:
    print('No')

Solution (Python):




s = input()
p = input()

if p in s * 2:
    print("Yes")
else:
    print("No")

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

s2 = s * 2
if p in s2:
  print('Yes')
else:
  print('No')

Solution (Python):
s = str(input())
p = str(input())
 
ans = False
 
for i in range(len(s)):
    a = True
    for k in range(len(p)):
        if s[(i+k)%(len(s))] != p[k]:
            a = False
            break
 
    if a == True:
        ans = True
        break
 
if ans == True:
    print("Yes")
else:
    print("No")

Solution (Python):
a = input()
b = input()
a += a[:-1]
if b in a:
    print("Yes")
else:
    print("No")

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

check = False

for i in range(len(s)):
  is_ans = True
  for k in range(len(p)):
    if s[(i+k)%(len(s))] != p[k]:
      is_ans = False
      break

  if is_ans:
    check = True
    break

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

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

str = ""
for i in range(max(100//len(s)+1,2)):
        str += s

if str.find(p) == -1:
        print("No")
else:
        print("Yes")

Solution (Python):
inp = input()
inp2 = inp*2

chk = input()

if chk in inp2:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
ling = s + s
ans = True
for i in range(len(s)):
    ans = True
    for j in range(len(p)):
        ans = ling[i + j] == p[j] and ans
    if ans:
        print("Yes")
        break

if not ans:
    print("No")

Solution (Python):
s = input()
p = input()
judge = True
x = s+s
if x.find(p) != -1:
    judge = True 
else:
    judge = False

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

Solution (Python):
import sys

S = str(input())
P = str(input())

for i in range(len(S)):
    FLG = True

    for k in range(len(P)):

        if S[(i+k)%(len(S))] != P[k]:
             FLG = False
             break
    if FLG == True:
        break

if FLG == True:
    print("Yes")

else :
    print("No")

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

ss = s*(len(s)//len(p)+1)

if p in ss:
    print("Yes")
else:
    print("No")

Solution (Python):
str = input()
str2 = input()
str=str+str

if str.find(str2) != -1:
  print('Yes')
else :
  print('No')

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

Solution (Python):
sente = input()
key = input()
sente += sente
if key in sente:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
p = input()
if p in s+s:
    print("Yes")
else:
    print("No")

Solution (Python):
l = [x for x in input()]
l.extend(l)
ch = [ x for x in input()]
txt = "No"
for i in range(len(l)-len(ch)):
    for j in range(len(ch)):
        if l[i+j] != ch[j]:
            break
    else:
        txt ="Yes"
        break
print(txt)

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

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

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

ss = s*2

if p in ss:
    print("Yes")
else:
    print("No")

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

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

for i in range(len(s)):
  string = ""
  if (len(s)-((i+1)+len(p)) < 0):
    string = s[i:] + s[:(i+1)+len(p)]
  else:
    string = s[i:]
  if string.startswith(p):
    print("Yes")
    break
  if i == len(s)-1:
    print("No")

Solution (Python):
s=input()*2
p=input()
print('YNeos'[p not in s::2])

Solution (Python):

s = input().rstrip()
p = input().rstrip()
s2 = s*2
print("Yes" if (p in s2) else "No")

Solution (Python):
from re import search


a = input()
b = input()
rg = '.*'.join(b)


def search_string():
    for i in range(len(a)):
        if search(b, a[i:]+a[:i]):
            return 'Yes'
    return 'No'


print(search_string())

Solution (Python):
s = input()
p = input()
flg = False
s1 = s + s
if p in s1:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
p=input()
spattern=[]
spattern.append(s)
pat=len(s)
plen=len(p)
flg=0
for i in range(1,pat):
    temp = spattern[i-1][1:] + spattern[i-1][0]
    spattern.append(temp)
for i, line in enumerate(spattern):
    for j in range(pat-plen+1):
        if line[j:j+plen] == p:
            flg = 1
            break
    if flg == 1:
        break
if flg == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
str = input()
str *= 2
compare = input()

if compare in str:
        print('Yes')
else:
        print('No')

Solution (Python):
s = str(input())
sdouble = s*2

p = str(input())

if sdouble.find(p)!= -1:
    print('Yes')
else:
    print('No')

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

n = len(p)
for x in range(n):
    flag = True
    for y in range(len(s)):
        if p[(x + y) % n] != s[y]:
            flag = False
            break
    if(flag):
        break

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

Solution (Python):
s = input()
p = input()
_s = s + s[:-1]
if p in _s:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
p = input()
if p in s+s:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
s += s
if p in s:
	print("Yes")
else:
	print("No")

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

Solution (Python):
a=input()
b=input()
a=a+a[:-1]
if a.find(b)!=-1:
        print("Yes")
else:
        print("No")

Solution (Python):
s = input() * 3
p = input()

print("Yes" if p in s else "No")

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

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

a = s*2
if p in a:
    print('Yes')
else:
    print('No')

Solution (Python):
r = input()
t = input()
rr = r+r
f = rr.find(t)
if f != -1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
p = input()
sList = list(s)
[sList.append(i) for i in s]
sStr = ''.join(sList)
judge = sStr.find(p)
if judge == -1:
    print("No")
else:
    print("Yes")

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

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

Solution (Python):
import sys

s, p = (line.strip() for line in sys.stdin.readlines())
print('Yes' if p in s + s else 'No')

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

s = s + s

if s.find(p) != -1:
	print('Yes')
else:
	print('No')

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

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

s = s*2

if p in s:
    print('Yes')
else:
    print('No')

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

S = s * 2

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

print("Yes")

Solution (Python):
text = input()
ptn = input()
print(['No', 'Yes'][(text*2).find(ptn) != -1])

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

if p in (s + s):
    print('Yes')
else:
    print('No')

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

s_l=[]
p_l=[]

for i in s:
    s_l.append(i)

for i in p:
    p_l.append(i)

for i in range(len(s_l)):
    j=0
    while j<len(p_l):
        k=i+j
        if k>=len(s_l):
            k=k-len(s_l)

        if s_l[k]==p_l[j]:
            j=j+1
        else:
            break
    if j==len(p_l):
        print("Yes")
        break
            
if j<len(p_l):
    print("No")

Solution (Python):
S=input();print(['No','Yes'][input()in S*2])

Solution (Python):
str1 =  str(input()) * 2
str2 =  str(input())
if (str1.find(str2) != -1 ):
    print("Yes")
else:
    print ("No")

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

Solution (Python):
string = input()
string1 = string+string 
try:
    string1.index(input())  
    print("Yes")
except ValueError:
    print("No")

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

print( "Yes" if p in s*2 else "No" )

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

s += s

if s.count(p):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
s = input()*2
p = input()

if p in s:
   print('Yes')
else:
   print('No')

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

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

Solution (Python):
s = input() * 2
p = input()

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

Solution (Python):
str = input()
sstr = str + str
pstr = input()
if (pstr in sstr):
    print("Yes")
else:
    print("No")

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

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

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