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):
n=str(input())
a=len(n)
N=list(n)
m=str(input())
A=len(m)
x=0
for i in range(a):
    C=[]
    for i in range(A):
        C.append(N[i])
    B=''.join(C)
    c=N[0]
    if B==m:
        x=x+1
    N.remove(c)
    N.append(c)
if x>0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
s=input()
p=input()
b=s
s+=s
ans=0
same_count=0
for i in range(len(b)):
    for j in range(len(p)):
        if s[i+j]==p[j]:
            same_count+=1

    if same_count==len(p):
        ans=1
    same_count=0

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

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

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

if s in p:
  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()
s *= 2
p = input()

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

Solution (Python):
import sys
s = input()
p = input()
ss = s + s
if (  p in ss ) ==True:
    print("Yes")
else:
    print('No')

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

for i in range(len(str)):
    strtemp = str[i:len(str)] + str[0:i]
    if p in strtemp:
        print("Yes")
        break
else:
    print("No")

Solution (Python):

W=str(input())
n=str(input())
w=W*2
if n in w:
    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() * 2
p = input()
print('Yes' if p in s else'No')

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

if p in s:
    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):





def main():
    s = input()
    p = input()

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


if __name__ == '__main__':
    main()

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

circle = text+text[:-1]

if circle.find(w) != -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()
s*=2
if s.find(p)!=-1:
    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()
p = input()
s += s[:len(p)]
if p in s:
    print('Yes')
else:
    print('No')

Solution (Python):
ring = input()
tag = input()

if tag in ring*2:
    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()
p=input()
s2=s*2
ren=s2.count(p)
if ren==0:
    print('No')
else:
    print('Yes')

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

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

Solution (Python):
s = list(input())
p = list(input())
for x in range(len(p)) :
    s.append(s[x])

i = 0
j = 0
while True :
    if p[j] == s[i] :
        j += 1
        if j == len(p) :
            print("Yes")
            break
        i += 1
        if i == len(s) :
            print("No")
            break
    else :
        i += (1 - j)
        if i == len(s) :
            print("No")
            break
        j = 0

Solution (Python):
ring = input()
s = input()
result = 'No'
for i in range(len(ring)):
    if s in ring:
        result = 'Yes'
        break
    ring = ring[1:] + ring[0]
print(result)

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

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

Solution (Python):
s=input()*2
p=input()
if(p in s):
    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()
p=input()
s*=2
if s.find(p)!=-1:
    print("Yes")
else:
    print("No")

Solution (Python):
N=input()
N=N+N
S=input()
if S in N:
    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()

ss = s*2




if (p in ss):
    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()
p=input()
match=False
for i in range(len(s)):
  if s[i]==p[0]:
    if len(p)>1:
      for j in range(1,len(p)):
        if s[(i+j)%len(s)]!=p[j]:
          break
        if j==len(p)-1:
          match=True
    else:
      match=True

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

Solution (Python):
import sys

s = list(input())
p = list(input())
for i in range(len(s)):
  counter = 0
  for j in range(len(p)):
    m = (i+j)%len(s)
    if s[m] == p[j]:
      counter += 1
  if counter == len(p):
    print('Yes')
    sys.exit()
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 s.find(p, 0, len(s) )>= 0 else "No")

Solution (Python):



s=input()*2
p=input()

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

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

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

s=s+s

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

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

s_long = s + s

judge = p in s_long
if judge:
    print('Yes')
else:
    print('No')

Solution (Python):
ring_str=input()
key=input()

ring_str+=ring_str

if key in ring_str:
    print('Yes')
else:
    print('No')

Solution (Python):
s=str(input())
p=str(input())
ss = s*2
hantei = p in ss

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

Solution (Python):
a=input()
b=input()
c=a*2

if b in c:
    print("Yes")
else:
    print("No")

Solution (Python):
n=input()
s = n + n
l=input()
b = s.count(l)
if b == 0:
    print("No")
else:
    print("Yes")

Solution (Python):
import sys
s = input()
ls = len(s)
s += s
p = input()
lp = len(p)
for i in range(ls):
    if s[i:i + lp] == p:
        print('Yes')
        sys.exit()
print('No')

Solution (Python):
S = input()
P = input()
for i in range(len(S)):
    if P in S[i:] + S[:i]:
        print("Yes")
        exit()
print("No")

Solution (Python):
s = input()
p = input()
s = s+s
if s.find(p) < 0:
        print('No')
else:
        print('Yes')

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

Solution (Python):
a = input()
b = input()
m = a*2
taiga = m.count(b)

if taiga >= 1:
    print("Yes")
else:
    print("No")

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

s = s * 2

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

print("No")

Solution (Python):



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

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

Solution (Python):
s = input()
s += s
p = input()
k = s.count(p)
if k>= 1:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input(); p = input()
for i in range(len(s)):
    sm = s[i:] + s[:i]
    if p in sm:
        print('Yes')
        exit()
print('No')

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

Solution (Python):
s_str = input()
p_str = input()
s_str = s_str * 2

if p_str in s_str:
    print('Yes')
else:
    print('No')

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

x=p in s1
if x==True:
    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()
p=input()
if p in s+s:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):
s=str(input())
p=str(input())
s+=s
if s.find(p)<0:
    print("No")
else:
    print('Yes')

Solution (Python):
s = input()
s = s + s[:-1]
p = input()




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

Solution (Python):
s=input()
p=input()
s=s+s
l=0
s=s.lower()
if  s.find(p)==-1:
    print('No')
else:
    print('Yes')

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

A=S.count(P)

if A==0:
    B=S+S
    C=B.count(P)
    if C==0:
        Q=0
    else:
        Q=C
else:
    Q=A
    


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

Solution (Python):

circle = input() * 2
target = input()
if target in circle:
    print("Yes")
else:
    print("No")

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

p = input()

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

Solution (Python):
a=[s for s in input()]*2
b=input()
w=False
for j in range(len(a)):
    if a[j]==b[0]:
        total=1
        if len(b)==1:
            print("Yes")
            w=True
            break
        for i in range(1,len(b)):
            if j+i==len(a):
                print("No")
                w=True
                break
            else:
                if a[j+i]==b[i]:
                    total+=1
                    if total==len(b):
                        print("Yes")
                        w=True
                        break
                else:
                    break
    if w==True:
        break
if w==False:
    print("No")

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

Solution (Python):
input_string = input()
pattern = input()

ring_string = input_string + input_string

if pattern in ring_string:
    print("Yes")
else:
    print("No")

Solution (Python):
text = list(input())
pattern = list(input())
for i in range(len(text)):
    
    flg = True
    for j in range(len(pattern)):
        if text[(i + j) % len(text)] != pattern[j]:
            flg = False
            break
    
    if flg:
        break

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

Solution (Python):
s1=input()
s2=input()

for i,x in enumerate(s1):
    if s2[0]==x:
        work=s1[i:]+s1
        if s2 in work :
            print("Yes")
            exit()
print("No")

Solution (Python):
s=input()
p=input()
s*=2
if s.find(p)!=-1:
    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):
a=input()
b=input()
a=a+a[:-1]
if a.find(b)!=-1:
        print("Yes")
else:
        print("No")

Solution (Python):
S,P = open(0).read().split()
if P in S+S:
    print("Yes")
else:
    print("No")

Solution (Python):
l=[]
s=input()
p=input()
d=len(p)
r=len(s)-len(p)
for i in range(r+1):
    u=s[i:i+len(p)]
    l.append(u)
y=0
for i in range(d):
    w=s[-len(p)+i:len(s)]+s[0:i]
    l.append(w)
d=l.count(p)
if d==0:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input(); p = input()
for i in range(len(s)):
    sm = s[i:] + s[:i]
    if p in sm:
        print('Yes')
        exit()
print('No')

Solution (Python):
s = input().replace("\r", "").replace("\n", "")
s *= 2
p = input().replace("\r", "").replace("\n", "")
print("Yes" if p in s else "No")

Solution (Python):
import sys

s = input()
p = input()

s_len = len(s)
p_len = len(p)
cur_s_pos = 0
cur_p_pos = 0

for i in range(s_len):
    if s[i] == p[0]:
        cur_s_pos = i
        cur_p_pos = 0
        
        try:
            for j in range(100):
                if s[cur_s_pos] == p[cur_p_pos]:
                    cur_s_pos += 1
                    cur_p_pos += 1
                else:
                    break

                if cur_p_pos == p_len:
                    break

                if cur_s_pos >= s_len:
                    cur_s_pos = 0
        except IndexError:
            print("s_pos, p_pos : %d, %d" % (cur_s_pos, cur_p_pos))
            sys.exit()

        if cur_p_pos == p_len:
            break

        

if cur_p_pos == p_len:
    print("Yes")
else:
    print("No")

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

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


resolve()

Solution (Python):
s = input()
len_s = len(s)
p = input()
len_p = len(p)

ans = "No"

for i in range(0, len_s - len_p + 1):
    if s[i:i+len_p] == p:
        ans = 'Yes'
        break
else:
    for j in range(len_p):
        if s[-j:] + s[:len_p - j] == p:
            ans = 'Yes'
            break
print(ans)

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

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

s_double = s * 2

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

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

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

pf=p[0]
l=len(pf)
flag=0
if pf in s:
  for i in range(len(s)):
    if s[i]==pf:
      word=''
      for j in range(i,i+len(p)):
        j=j%(len(s))
        word+=s[j]
      if word==p:
        flag=1
        break
if flag:
  print('Yes')
else:
  print('No')

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

Solution (Python):
s = str(input())
p = str(input())
m = s + s[0:-1]
if 0 <= m.find(p):
    print('Yes')
else:
    print('No')

Solution (Python):
s = str(input())
p = str(input())
m = s + s[0:-1]
if 0 <= m.find(p):
    print('Yes')
else:
    print('No')

Solution (Python):
s=str(input())
p=str(input())
S=list(s)
x=0
for i in range(len(s)):
    if p in s:
        print('Yes')
        x=1
        break
    S.append(S[0])
    S.pop(0)
    s=''.join(S)
if x==0:
    print('No')

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

Solution (Python):
s = str(input())
p = str(input())
s = s + s
if s.find(p) < 0:
    print("No")
else:
    print("Yes")

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

Solution (Python):


s = input().upper()*2
p = input().upper()

if p in 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):
w=input().casefold()
word=w*2


key=input()

if key in word :
    print("Yes")
else:
    print("No")

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

Solution (Python):


def main():
    string = input()
    p=input()
    string+=string

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

if __name__=="__main__":
    main()

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

size_s = len(s)
size_p = len(p)

_s = s+s

for i in range(size_s):
    if _s[i: i + size_p] == p:
        print("Yes")
        quit()

print("No")

Solution (Python):

s = input()
p = input()

ss = s + s

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

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

k=s*100

if (p in k)==True:
    print('Yes')
else:
    print('No')

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

c=s.count(p)
if c>=1:
    print("Yes")
else:
    print("No")

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

def search_string_in_cycle_string(s, p):
    code = s + s
    for index in range(len(s)):
        tmp = code[index:index+len(p)]
        if p == tmp:
            return True
    return False

if search_string_in_cycle_string(s, p):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
x = input() * 2
w = input()

print("Yes" if w in x 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()
s += s
if p in s:
    print("Yes")
else:
    print("No")

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

S=s+s

x+=S.find(p)




if x==-1:
    print('No')
else :
    print('Yes')

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

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

Solution (Python):
from collections import deque
p = input()
s = input()

d = deque([s for s in p])

for i in range(len(s)):
    str_d = "".join(d)
    if s in str_d:
        print("Yes")
        break
    d.append(d.popleft())
    if i == len(s) - 1:
        print("No")

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

Solution (Python):
a = input()
b = input()
m = a*2
taiga = m.count(b)

if taiga >= 1:
    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()
S = s*2
a = S.count(p)
if a >=1:
    print('Yes')
else:
    print('No')

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

Solution (Python):
s = input()
strs = s + s
check = input()
if strs.find(check) < 0:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()
p = input()
s = s + s
ans = s.find(p)

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

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

Solution (Python):
s = input()
p = input()
s *= 2
ans = 'No'
for i in range(len(s)):
    if s[i:i+len(p)] == p:
        ans = 'Yes'
        break
print(ans)

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

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

ss = s+s

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

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

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

if (p in s) == True:
    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()
p = input()

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

Solution (Python):
S = str(input())
S2 = S * 2
s = str(input())
checker = s in S2

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

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

Solution (Python):
a = [list(input()) for i in range(2)]
for i in range(len(a[0])):
  for j in range(len(a[1])):
    if i+j< len(a[0]):
        if a[0][i+j] != a[1][j]:
          break
    else:
        if a[0][i+j-len(a[0])] != a[1][j]:
          break
    if j == len(a[1]) - 1:
      print('Yes')
      exit()
print('No')

Solution (Python):
from collections import deque

s = input()
t = input()
n = len(s)
d = deque(s)
for i in range(n):
    p = d.pop()
    d.appendleft(p)
    u = ''.join(d)
    if t in u:
        print('Yes')
        exit()
print('No')

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

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

Solution (Python):
import re

ch1 = input()*2
ch2 = input()

if re.search(ch2, ch1):
    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()
s+=s

p = input()

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

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

Solution (Python):
s, p = [input() for _ in range(2)]

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

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

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


def search(s, p):
    index = [i for i, x in enumerate(s) if x == p[0]]
    while len(s) <= 100:
        s += s
    for index in index:
        for i in range(0, len(p)):
            if s[index + i] != p[i]:
                break
            if i == len(p) - 1:
                return 'Yes'
    return 'No'


print(search(s, p))

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

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

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

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

Solution (Python):
S=input()

print(['No','Yes'][input()in S*2])

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

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

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

sl=len(s)
k=0

for i in range(sl):
    if p in s:
        k=1
        break
    else:
        s=s[-1]+s[:-1]


if k==1:
    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 = str(input())
s2 = s*2
p = str(input())

if s2.count(p) > 0:
    print('Yes')
else:
    print('No')

Solution (Python):
x=input()
y=input()
X=x*2
if X.find(y)==-1:
    print("No")
else:
    print("Yes")

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

s += s

if p in s:
    print('Yes')

else:
    print('No')

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

def search_from(i):
    found = True
    for j in range(len(p)):
        k = (i + j) % len(s)
        if s[k] != p[j]:
            found = False
            break
    return found

found = False
for i in range(len(s)):
    found = search_from(i)
    if found:
        break
    
if found:
    print("Yes")
else:
    print("No")

Solution (Python):
s = str(input())
p = str(input())
s1 = s*2
b = s1.count(p)
if b >= 1:
    print('Yes')
else:
    print('No')

Solution (Python):
s=str(input())
s1=s+s
s2=str(input())
if s1.find(s2) != -1:
    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()
p = input()
s = s * 2
if p in s:
    print("Yes")
else:
    print("No")

Solution (Python):

from sys import stdin



s = stdin.readline().rstrip()
p = stdin.readline().rstrip()

s = s * 2


cnt_match_inrow=0
p_index = 0
match_start_index = 0
match_start_buf=0
s_index = -1

while s_index < len(s)-1:
  s_index+=1
  if s[s_index] == p[p_index]:
    if p_index == 0:
      match_start_index = s_index
    p_index += 1
    cnt_match_inrow += 1
    if cnt_match_inrow == len(p):
      print('Yes')
      break
  else:
    p_index = 0
    s_index -= cnt_match_inrow
    cnt_match_inrow = 0
else:
  print('No')

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

s += s

if s.find(p) >= 0:
    print('Yes')
elif s.find(p) < 0:
    print('No')

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    s = input().rstrip()
    t = input().rstrip()
    
    for i in range(len(s)):
        temp_word = ""
        for k in range(len(t)):
            if i + k <= len(s)-1:
                temp_word += s[i + k]
            else:
                temp_word += s[i + k - len(s)]
        if temp_word == t:
            print("Yes")
            sys.exit()
    
    print("No")
    
    
if __name__ == "__main__":
    main()

Solution (Python):
S = input()
P = input()
S = S + S
if S.find(P) < 0:
    print('No')
else:
    print('Yes')

Solution (Python):
def run():
    first_line=input()
    second_line=input()
    
    virt_line=first_line+first_line[0:len(second_line)]
    find_flag=False
    for i in range(len(first_line)):
        same=True
        for j in range(len(second_line)):
            
            if second_line[j] != virt_line[i+j]:
                same=False
            
        if same is True:
            find_flag=True
            
    if find_flag:
        print("Yes")
    else:
        print("No")

run()

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

ss = s + s
l = len(p)

result = "No"

for idx, e in  enumerate(ss):
    
    if idx > len(s):
        break
    
    if ss[idx:l+idx] == p:
        result = "Yes"
        break

print(result)

Solution (Python):
s1,s2=input(),input()
s3=s1+s1

if s2 in s3:
	print("Yes")
else:
	print("No")

Solution (Python):
s = input()
p = input()
result = 'No'
for i in range(len(s)):
    target = s[i:] + s[:i]
    if p in target:
        result = 'Yes'
        break

print(result)

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

s *= 2

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

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

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

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

if p in t:
    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()
s=S*2
if p in s:
    print('Yes')
else:
    print('No')

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

ss=s*2

if p in ss:
    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+s[:-1]
if s.find(p) != -1:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
p=input()
s=s*2
if s.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()

s += s

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

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

Solution (Python):
s = input()
s += s * 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()
p = input()

if s.count(p)>0:
    print('Yes')
else:
    S = s+s

    if S.count(p)>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()
p = input()
s = s + s

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):
import re

n = input()
m = input()

l = n + n
s = re.search(m, l)

if s != None:
    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 + s
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()
t = s[0:-1]
s += t

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

Solution (Python):
ring_str = input()
key = input()

ring_str += ring_str

if key in ring_str:
    print('Yes')
else:
    print('No')

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

if __name__ == "__main__":
    main()

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

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

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

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

S = s+s

i = S.find(p)

if i>=0 :
    print('Yes')
if i==-1:
    print('No')

Solution (Python):
s = input()
p = input()
if p in s*2:
    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 *= 2

if s.find(p) != -1:
    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=str(input())
p=str(input())
s=s*2
if p in s:
    print("Yes")
else:
    print("No")

Solution (Python):
p = [x for x in input()]
p_len = len(p)
s = input()

for i in range(p_len):
    jadge_string = "".join(p)
    if s in jadge_string:
        print("Yes")
        break
    elif i == p_len-1:
        print("No")
    else:
        c = p.pop(0)
        p.append(c)

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

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

c = a + a

if b in c:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
p = list(input())
for x in range(len(p)) :
    s.append(s[x])

i = 0
j = 0
while True :
    if p[j] == s[i] :
        j += 1
        if j == len(p) :
            print("Yes")
            break
        i += 1
        if i == len(s) :
            print("No")
            break
    else :
        i += (1 - j)
        if i == len(s) :
            print("No")
            break
        j = 0

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

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

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

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

def get_ring(index):
    global s
    for _ in range(len(s)):
        yield s[index]
        
        if index < len(s) - 1:
            index += 1
        else:
            index = 0
            
for i in range(len(s)):
    if s[i] != p[0]:
        continue
    
    off = 0
    for char in get_ring(i):
        if p[off] != char:
            break
        off += 1
        if off == len(p):
            break
        
    if off == len(p):
        print("Yes")
        break
    
else:
    print("No")

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

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

t = s*2

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

Solution (Python):
s = input().lower()
t = input().lower()
s = s+s
if s.find(t)!=-1:
    print('Yes')
else:
    print('No')