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

def find(A,i,B,j):
    if(A[i]!=B[j]):
        return 0
    elif(j==len(B)-1):
        return 1
    else:
        return find(A,(i+1)%len(A),B,j+1)



str=list(input())
key=list(input())
for i in range(0,len(str)):
    if(find(str,i,key,0)):
        print("Yes")
        sys.exit()
print("No")

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

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

Solution (Python):
s = input()
p = input()
if p in s:
    print("Yes")
elif len(p) == 1:
    print("No")
else:    
    for i in range(1, len(p)):
        if p[:i] == s[-i:] and p[i:] == s[:len(p)-i]:
            print("Yes")
            break
        if i == len(p)-1:
            print("No")

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

Solution (Python):





N=input()
N=N*2
S=input()

if S in N:
    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()

ss = s + s

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

Solution (Python):
str_in = []
while True:
    try :
        str_in.append(input()) 
    except :
        break
s = str_in[0]
p = str_in[1]

flag = False
for i in range(0, len(s)):
    flag = True
    for j in range(0, len(p)):
        if (s[(i + j) % len(s)] != p[j]):
            flag = False
            break
    if (flag):
        break
if (flag):
    print('Yes')
else :
    print('No')

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

Solution (Python):
strS = str(input())
strP = str(input())
longS = ''

for i in range(2):
    longS += strS

if strP in longS:
    print('Yes')
else:
    print('No')

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

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

ring = s * 2

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

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

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

Solution (Python):
s = str(input())
p = str(input())
S = s*3
k = 0

for i in range(len(S)):
    
    if S[i:len(p)+i:] == p:
        k = k+1

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

Solution (Python):
s = input()

str = 2 * s
s = input()

print("Yes" if s in str 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()

ring = s + s

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

Solution (Python):
def ring(s, p):
	t = list(s)
	for i in range(len(s)):
		if ''.join(s[i:] + s[:i]).find(p) > -1:
			return 'Yes'
	return 'No'

s = input()
p = input()
print(ring(s, p))

Solution (Python):


def figure(s, p):
    if p in s:
        return True

    i = 0
    while True:
        idx = p[i:].find(s[-1]+s[0])
        if idx == -1:
            break
        idx += i
        if s[-(idx+1):]+s[:len(p)-(idx+1)] == p:
            return True
        i = idx+1
    return False

if __name__ == '__main__':
    s, p = raw_input(), raw_input()
    print 'Yes' if figure(s, p) else 'No'

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

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

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

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