Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

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



Sample input:
vanceknowledgetoad
advance


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
def main():

    sentence = input()
    phrase = input()

    for i in range(len(sentence)):
        if phrase in sentence:
            print("Yes")
            break
        else:
            sentence = sentence[1:] + sentence[0]
    print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():

    sentence = input()
    phrase = input()

    for i in range(len(sentence)):
        if phrase in sentence:
            print("Yes")
            break
        else:
            sentence = sentence[1:] + sentence[0]
        print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
print("Yes") if (input()*2).find(input())>-1 else "No"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("Yes" if 2*input().find(input()) >= -1 else "No")

Submission status: Wrong Answer

Solution code:
print("Yes" if 2*input().find(input()) > -1 else "No")

Submission status: Wrong Answer

Solution code:
r=input()
a=input()
if a in r+r:
	print('yes')

Submission status: Wrong Answer

Solution code:
def judg_unit(ss,pp):
    sss = ss + ss + ss
    result = sss.find(pp)
    if result != -1:
        return True
    else :
        return False

s = str(input())
p = str(input())
print(judg_unit(s,p))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
data = input()
target = input()

start = 0
flag = "No"
for i in target:
    if(data[start:].find(i)):
        start = data[start:].find(i)
    elif(data[:start].find(i)):
        start = data[:start].find(i)
    else:
        print("No")
        break
    if(i == target[-1]):
        print("Yes")
        break

Submission status: Wrong Answer

Solution code:
s=raw_input()
s+=s
print ['No','Yes'][s.find(raw_input())>0]

Submission status: Wrong Answer

Solution code:
s=raw_input()
p=raw_input()

hits=[]
for j in range(len(s)):
    if p[0] == s[j]:
        hits.append(j)


flg=False
_i = 0
for _j in hits:
    j=_j
    while True:
        for idx, i in enumerate(range(_i, len(p))):
            if j + i > len(s) -1:
                break 
            if p[i] == s[j+idx]:
                flg=True
            else:
                flg=False
                break
        else:
            break

        if flg:
            j = 0
            _i = i
        else:
            break

if flg:
    print "yes"

Submission status: Wrong Answer

Solution code:
s=raw_input()
p=raw_input()

hits=[]
for j in range(len(s)):
    if p[0] == s[j]:
        hits.append(j)


flg=False
_i = 0
for _j in hits:
    j=_j
    while True:
        for idx, i in enumerate(range(_i, len(p))):
            if j + i > len(s) -1:
                break 
            if p[i] == s[j+idx]:
                flg=True
            else:
                flg=False
                break
        else:
            break

        if flg:
            j = 0
            _i = i
        else:
            break

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

Submission status: Wrong Answer

Solution code:
import sys
s1=raw_input()
s2=raw_input()


for idx, s in enumerate(s1):
    if s2[0] != s:
        continue
    
    s1_idx = 0
    s2_idx = 0
    while True:
    
        s1_now = s1[:s1_idx]
        s2_now = s2[:s2_idx]
        if len(s1_now) >= len(s2_now):
            if s2_now in s1_now:
                print "Yes"
                sys.exit(0)
            else:
                break
        else:
            if s2_now.startswith(s1_now):
                s1_idx = 0
                s2_idx += len(s1_now)

print "No"

Submission status: Wrong Answer

Solution code:
import sys
s1=raw_input()
s2=raw_input()

for idx, s in enumerate(s1):
    if s2[0] != s:
        continue
    
    s1_idx = idx
    s2_idx = 0
    while True:
    
        s1_now = s1[s1_idx:]
        s2_now = s2[s2_idx:]
        if len(s1_now) >= len(s2_now):
            if s2_now in s1_now:
                print "Yes"
                sys.exit(0)
            else:
               break
        else:
            if s2_now.startswith(s1_now):
                s1_idx = 0
                s2_idx += len(s1_now)
            else:
                break

print "No"

Submission status: Wrong Answer

Solution code:
s=input()
r=input()
if((s*2).find(r)):
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
p = raw_input()
print "YES" if raw_input() in p * 2 else "NO"

Submission status: Wrong Answer

Solution code:
s=input()
p=input()
ring=s+s
if p in ring :
 print("True")
else :
 print("False")

Submission status: Wrong Answer

Solution code:
S = raw_input()
P = raw_input()
count = S.count(P[0])
if count == 0:
    print 'No'
else:
    start = 0
    i = 1
    for c in range(count):
        i = 1
        if c > 0:
            start = S[(start+1):].index(P[0]) + (start+1)
        else:
            start = S[start:].index(P[0])
        for p in P[1:]:
            if S[(start+i) % len(S)] != p:
                break
            i += 1
    if i == len(P):
        print 'Yes'
    else:
        print 'No'

Submission status: Wrong Answer

Solution code:
s = raw_input()
s_list = list(s)
judge = 0
p = raw_input()
for i in range(len(s)):
	if list(s)[i] == list(p)[0]:
		s_list.extend(list(s)[0:i+1])
		del s_list[0:i+1]
	s = "".join(s_list)
	if p in s:
		judge = 1
if judge :
	print 'True'
else :
	print 'False'

Submission status: Wrong Answer

Solution code:
s = raw_input()
s_list = list(s)
judge = 0
p = raw_input()
for i in range(len(s)):
	if list(s)[i] == list(p)[0]:
		s_list.extend(list(s)[0:i+1])
		del s_list[0:i+1]
	s = "".join(s_list)
	if p in s:
		judge = 1
if judge :
	print 'Yes'
else :
	print 'No'

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
p_len = len(p)

if p in s:
    print("Yes")
else:
    for i in range(1, p_len - 1):
        if (p[:i] == s[-i:]) and (p[i:] == s[:p_len - i]):
            print("Yes")
            break
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
ringstr = raw_input()
matchstr = raw_input()

ringstrlen = len(ringstr)
matchstrlen = len(matchstr)
x = 0 # match length
y = 0 # ring length
finflag = False
while True:
    if x == matchstrlen:
        print "Yes"
        break
    if y == ringstrlen:
        y=0
        finflag =True
    if matchstr[x]==ringstr[y]:
        x+=1
    else:
        if finflag:
            print "No"
            break
        x=0
    y+=1

Submission status: Wrong Answer

Solution code:
def myfindall(s,ps):
    # start = 0
    matchlist =[]
    while True:
        tmp = s.find(ps)
        if tmp < 0 :
            break
        if len(matchlist)>0:
            matchlist.append(tmp+matchlist[-1]+1)
        else:
            matchlist.append(tmp)
        s = s[tmp+1:]
    return matchlist

instr = raw_input()
findstr = raw_input()
matchlist = myfindall(instr,findstr[0])
print matchlist
matchflag = False
y=0
for x in matchlist:
    if not matchflag:
        break
    while True:
        if y >= len(findstr):
            print "Yes"
            y=0
            break
        if x >= len(instr):
            x = 0
        if instr[x]==findstr[y]:
            x+=1
            y+=1
        else:
            "No"
            y=0
            break

Submission status: Wrong Answer

Solution code:
def myfindall(s,ps):
    # start = 0
    matchlist =[]
    while True:
        tmp = s.find(ps)
        if tmp < 0 :
            break
        if len(matchlist)>0:
            matchlist.append(tmp+matchlist[-1]+1)
        else:
            matchlist.append(tmp)
        s = s[tmp+1:]
    return matchlist

instr = raw_input()
findstr = raw_input()
matchlist = myfindall(instr,findstr[0])
matchflag = False
y=0
for x in matchlist:
    if matchflag:
        break
    while True:
        if y >= len(findstr):
            print "Yes"
            y=0
            break
        if x >= len(instr):
            x = 0
        if instr[x]==findstr[y]:
            x+=1
            y+=1
        else:
            "No"
            y=0
            break

Submission status: Wrong Answer

Solution code:
def find_word(sent, word):
    w = word    
    if sent.find(w) > -1:
        return w,"Yes"
    elif len(w) == 0:
        return w,"No"
    else:
        return find_word(sent,w[:-1])


sent = raw_input()
word = raw_input()
s = ""
s,y = find_word(sent,word)

b = word.replace(s,"")

a,y= find_word(sent,b)
print y

Submission status: Wrong Answer

Solution code:
def find_word(sent, word):
    w = word    
    if sent.find(w) >= 0:
        return w
    elif len(w) == 0:
        return w
    else:
        return find_word(sent,w[:-1])

sent = raw_input()
word = raw_input()

s = find_word(sent,word)
b = word.replace(s,"")

if sent.find(b) >=0:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
def find_word(sent, word):
    w = word    
    if len(w) > 1 :
        if sent.find(w) >= 0:
            return w
        else:
            return find_word(sent,w[:-1])
    else :
        return "No"

sent = raw_input()
word = raw_input()

s = find_word(sent,word)
if s in "No":
    print "No"
else:
    s = word.replace(s,"")

    if sent.find(s) >=0:
        print "Yes"
    else:
        print "No"

Submission status: Wrong Answer

Solution code:
def find_word(sent, word,s):
    w = word    
    if len(w) > 0 :
        if sent.find(w) >= 0:
            return s
        else:
            s+=1
            return find_word(sent,w[:-1],s)
    else :
        return -1

sent = raw_input()
word = raw_input()
s=0
s = find_word(sent,word,s)
if s == -1:
    print "No"
else:
    s = word[0:len(word)-s]

    if sent.find(s) >=0:
        print "Yes"
    else:
        print "No"

Submission status: Wrong Answer

Solution code:
def find_word(sent, word,s):
    w = word    
    if len(w) > 0 :
        if sent.find(w) >= 0:
            return s
        else:
            s+=1
            return find_word(sent,w[:-1],s)
    else :
        return -1

sent = raw_input()
word = raw_input()
s=0
s = find_word(sent,word,s)
if s == -1:
    print "No"
else:
    s = word[len(word)-s:len(word)]

    if sent.find(s) >=0:
        print "Yes"
    else:
        print "No"

Submission status: Wrong Answer

Solution code:
def find_word(sent, word,s):
    w = word    
    if len(w) > 0 :
        if sent.find(w) >= 0:
            return s
        else:
            s+=1
            return find_word(sent,w[:-1],s)
    else :
        return -1

sent = raw_input()
word = raw_input()
s=0
s = find_word(sent,word,s)
if s == -1:
    print "No"
else:
    s = word[len(word)-s:len(word)]

    if sent.find(s) ==0:
        print "Yes"
    else:
        print "No"

Submission status: Wrong Answer

Solution code:
a = raw_input()
b = raw_input()
a = a+a
if 0 < a.find(b):
    print 'Yes'
else:
    print 'No'

Submission status: Wrong Answer

Solution code:
import re

Submission status: Wrong Answer

Solution code:
# 18-Character-Ring.py

# ????????°
# ???????????????????????°??¶???????????? s ???????????????????????????????¨????????????£?¶????????????????????????????????????§???
# ????????? p ??????????????????????????????????????°????????????????????????????????????

# Input
# ????????????????????? s ????????????????????????
# ????????????????????? p ????????????????????????

# Output
# p ??????????????´?????? Yes ??¨?????????????????´?????? No ??¨????????????????????????????????????

# Constraints
# 1???p????????????s????????????100
# ??????????????±?°???????????????????

# Sample Input 1
# vanceknowledgetoad
# advance
# Sample Output 1
# Yes

# Sample Input 2
# vanceknowledgetoad
# advanced
# Sample Output 2
# No

import re

pattern=[]

s=input()
p=input()

s= s+s

for p2 in list(p):
	pattern.append(p2)
	pattern.append(".*")

pattern = "".join(pattern)
print(pattern)

matchOB = re.search(p, s)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math

S = raw_input()
S = S[:len(S)-1]
S = S*2

T = raw_input()
T = T[:len(T)-1]

if T in S:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
ring = input()
ring_double = ring *2
test = input()
if test in ring_double:
	print('True')
else:
	print('No')

Submission status: Wrong Answer

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

a = s*2
if a.find(p) > -1:
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

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

a = s*2
if a.find(p):
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

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

a = s*2
if a.count(p):
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

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

a = s*2
if p in a:
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = input()
P = input()
e = s + s
x = len(P)
m = 0
count = 0
for i in range(len(s)):
    if P == e[m:x]:
        count += 1
    m += 1
    x += 1
    if count >= 1:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
s = input().lower()
p = input().lower()

a = s*2
if p in a:
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = input().lower()
p = input().lower()

a = s*2
if p < s:
    if p in a:
        print('yes')
    else:
        print("no")

Submission status: Wrong Answer

Solution code:
s = input().lower()
p = input().lower()

s *= 2

if s.find(p) != 1:
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

Solution code:
s = input().lower()
p = input().lower()

s *= 2

if s.find(p) != -1:
    print('yes')
else:
    print("no")

Submission status: Wrong Answer

Solution code:
def check(s, p):
    count = 0
    for i in range(len(s)):
        for j in range(len(p)):
            if s[(i+j) % len(s)] != p[j]:
                break
            count += 1
        if count == len(p):
            return True
    return False

s = raw_input()
p = raw_input()
flag = check(s, p)
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = str(raw_input())
p = str(raw_input())

i = 0
j = 0
k = 0
while i < len(s):
    if j == len(p):
        print "Yes"
        break
    if p[j] == s[i]:
        j += 1
    elif p[j] != s[i] and j != 0  and k >= len(s):
        print "No"
        break
    elif p[j] != s[i] and j != 0  and k < len(s):
        j = 0
    elif k == len(s)+len(p):
        print "No"
        break
    i += 1
    k += 1
    if i == len(s):
        i = 0

Submission status: Wrong Answer

Solution code:
s = str(raw_input())
p = str(raw_input())

i = 0
j = 0
k = 0
while i < len(s):
    if j == len(p):
        print "Yes"
        break
    if p[j] == s[i]:
        j += 1
    elif p[j] != s[i] and j != 0  and k >= len(s):
        print "No"
        break
    elif p[j] != s[i] and j != 0  and k < len(s):
        j = 0
        if i == len(s):
            i = 0
        continue
    elif k == len(s)+len(p):
        print "No2"
        break
    i += 1
    k += 1
    if i == len(s):
        i = 0

Submission status: Wrong Answer

Solution code:
s = str(raw_input())
p = str(raw_input())

i = 0
j = 0
k = 0
while i < len(s):
    if j == len(p):
        print "Yes"
        break
    if p[j] == s[i]:
        j += 1
    elif p[j] != s[i] and j != 0  and k >= len(s):
        print "No"
        break
    elif p[j] != s[i] and j != 0  and k < len(s):
        j = 0
        if i == len(s):
            i = 0
        continue
    elif k == len(s)+len(p):
        print "No"
        break
    i += 1
    k += 1
    if i == len(s):
        i = 0

Submission status: Wrong Answer

Solution code:
s = str(raw_input())
p = str(raw_input())

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

Submission status: Wrong Answer

Solution code:
x = raw_input()
y = raw_input()
a = [["advancedknowledge"]for i in range(10)]
b = ""
for i in a:
    b = b + "".join(i)
if b.count(x) > 0:
    print("Yes")
else: print("No")

if b.count(y) > 0:
    print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
x = raw_input()
y = raw_input()
a = [["advanceknowledge"]for i in range(10)]
b = ""
for i in a:
    b = b + "".join(i)
if b.count(x) > 0:
    print("Yes")
else: print("No")

if b.count(y) > 0:
    print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
x = raw_input()
y = raw_input()
a = [["advanceknowledge"]for i in range(10)]
b = ""
for i in a:
    b = b + "".join(i)


if b.count(y) > 0:
    print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
x = raw_input()
y = raw_input()
##advencedknowledge
a = [["advanceknowledge"]for i in range(10)]
b = ""
for i in a:
    b = b + "".join(i)


if b.count(y) > 0:
    print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
wor = raw_input()
word = raw_input()
a = [["advanceknowledge"]for i in range(10)]
b = ""
for i in a:
    b = b + "".join(i)


if b.count(word) > 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input_str = input()
target_str = input()
if target_str in input_str:
    print('Yes')
else:
    ret = ''
    r_str = input_str[::-1]
    try:
        idx = r_str.index(target_str[0])
    except ValueError:
        print('No')
    else:
        ret += r_str[idx::-1]
        size = len(target_str) - len(ret)
        ret += input_str[:size]
        if ret == target_str:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
s = input() * 2
p = input()
if s.find(p):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(len(s)):
    check = s[i:] + s[:i]
    is_ok = True
    for c in p:
        if c in check:
            check = check[check.index(c):]
        else:
            is_ok = False
            continue
    if is_ok:
        print('Yes')
        break
if not is_ok:
    print('No')

Submission status: Wrong Answer

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

for i in range(len(s)):
    ring = s[i:] + s[:i]
    j = len(p) - 1
    while j > 0:
        if p[:j] in ring:
            start = ring.index(p[:j])
            end = start + len(ring)
            ring = ring[0:start] + ring[end:]
            p = p[j:]
            j = len(p)
            if not p:
                print('Yes')
                break
        else:
            j -= 1
if p:
    print('No')

Submission status: Wrong Answer

Solution code:
s = raw_input()
p = raw_input()

slen = len(s)
plen = len(p)
flag = False

for i in xrange(len(s)):
    print plen
    j = 0
    while(j < plen and s[(i+j)%slen] == p[j]):
        j += 1
    if (j == plen):
        flag = True

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

Submission status: Wrong Answer

Solution code:
x = str(input())
y = str(input())

s = []
for i in x:
    s.append(i)
p = []
for i in y:
    p.append(i)

n = len(p)
flag = 0
for i in range(len(s)):
    if i+n > len(s):
        if s[i:]+s[0:(i+n)%len(s)] == p:
            print('Yes')
            flag = 1
    else:
        if s[i:i+n] == p:
            print('Yes')
            flag = 1

if flag == 0:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys

lines = [line for line in sys.stdin]
s = lines[0] + lines[0]
p = lines[1]
if s.find(p) != -1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
flag = 1
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in alphabet:
    if s.count(i) < p.count(i):
        flag = 0
        print("No")
        break
if flag == 1:
    print("Yes")

Submission status: Wrong Answer

Solution code:
str_list = input().rstrip()
str_search = input().rstrip()

str_list = str_list + str_list

print(str_search in str_list)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(len(s)):
	if p[0] == s[i]:
		for j in range(len(p)):
			if p[j] == s[(i+j)%len(s)]:
				t += 1
				#print(t)
			else:
				t = 0
				#print(t)
if t >= len(p):
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

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

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

if t < len(p):
	print('No')

Submission status: Wrong Answer

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

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

if t < len(p):
	print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
p = list(input())
import sys
t=0

for i in range(len(s)):
	if p[0] == s[i]:
		for j in range(len(p)):
			if p[j] == s[(i+j)%len(s)]:
				t += 1
				#print(t)
			else:
				t=0
			if t == len(p):
				print('Yes')
				sys.exit()

if t < len(p):
	print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
p = list(input())
print(len(p))
import sys
t=1

for i in range(len(s)):
	if p[0] == s[i]:
		for j in range(len(p)-1):
			if p[j+1] == s[(i+j+1)%len(s)]:
				t += 1
				#print(t,j,i+j)
			else:
				t = 0
			if t == len(p):
				#print('Yes')
				sys.exit()

if t < len(p):
	print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
p = list(input())
#print(len(p))
import sys

for i in range(len(s)):
	if p[0] == s[i]:
		t = 1
		for j in range(len(p)-1):
			if p[j+1] == s[(i+j+1)%len(s)]:
				#print(t, end = '')
				t = t+1
				#print(t)
			else:
				t = 0
			if t == len(p):
				print('Yes')
				sys.exit()

if t < len(p):
	print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
p = list(input())
#print(len(p))
import sys
t=0

for i in range(len(s)):
	for j in range(len(p)):
		if p[j] == s[(i+j)%len(s)]:
			t = t+1
		else:
			t = 0
		if t == len(p):
			print('Yes')
			sys.exit()

if t < len(p):
	print('No')

Submission status: Wrong Answer

Solution code:
sam = input()
ans = input()
for i in range(1, len(ans) + 1) :
    if (ans[:i] in sam) == False : break
if ((ans[i - 1 :]) in sam) == True : print('Yes')
else                               : print('No')

Submission status: Wrong Answer

Solution code:
sam = input()
ans = input()
for i in range(len(ans)) :
    if (ans[:i] in sam) == False : break

if ((ans[i - 1 :]) in sam[:len(ans[i-1:])]) == True : print('Yes')
else                                                : print('No')

Submission status: Wrong Answer

Solution code:
sam = input()
ans = input()
for i in range(len(ans)) :
    if (ans[:i] in sam) == False : break

print(ans[ :i-1])
print(ans[i-1:])

if   ((ans[i - 1 :]) in sam[:i-1]) == True and len(ans) != 1 : print('Yes')
elif (ans in sam) == True                                    : print('Yes') 
else                                                         : print('No')

Submission status: Wrong Answer

Solution code:
sam = input()
ans = input()
for i in range(len(ans)) :
    if (ans[:i] in sam) == False : break

if   ((ans[i - 1 :]) in sam[:len(ans[i-1:])])== True and len(ans) != 1 : print('Yes')
elif (ans in sam) == True                                      : print('Yes') 
else                                                           : print('No')

Submission status: Wrong Answer

Solution code:
sam = input()
ans = input()
for i in range(1, len(ans) + 1) :
    if (ans[:i] in sam) == False : break
if   ((ans[i - 1 :]) in sam[: len(ans[i - 1 : ])]) == True : print('Yes')
elif ans in sam                                            : print('Yes') 
else                                                       : print('No')

Submission status: Wrong Answer

Solution code:
s=input()*3
print(s)
if s.find(input()) == -1 :
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
bl = True
for i in range(1,len(s)+1):
    if p[0:i] == s[-i:]:
        if p[i:] == s[0:len(p)-i]:
            print("Yes")
            bl = False
            break
if bl:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
if s in p*2:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
flag = 0
for i in range(len(s)):
    if flag == 1:
        break
    if s[i] == p[0]:
        for j in range(1, len(p)):
            i = (i + 1) % len(s)
            if s[i] != p[j]:
                break
            if j == len(p)-1:
                print("Yes")
                flag = 1
                break
if flag == 0:
    print("No")

Submission status: Wrong Answer

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

for i in range(len(s)):
    if i == 0 and ring_str.find(s) != -1:
        print('Yes')
        break
    if i != 0 and ring_str.find(s[:i]) == len(ring_str) - len(s[:i]):
        if s[i:] == ring_str[:len(s[i:])]:
            print('Yes')
            break
    if i == len(s) - 1:
        print('No')

Submission status: Wrong Answer

Solution code:
import re

ring_str = input()
s = input()

for i in range(len(s)):
    if i == 0 and ring_str.find(s) != -1:
        print('Yes')
        break
    match_head = re.search(r'^' + s[:i], ring_str)
    match_foot = re.search(s[i:] + r'$', ring_str)
    if i != 0 and match_head is not None and match_foot is not None:
        if s[i:] == ring_str[:len(s[i:])]:
            print('Yes')
            break
    if i == len(s) - 1:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=[ord(i) for i in input()]
n=[ord(i) for i in input()]
flag=0
flack=0
for i in range(len(s)):
    flack=0
    if n[0]==s[i]:
        flack=1
        for j in range(1,len(n)):
            if i+j>=len(s):
                if n[j]==s[i+j-len(s)]:
                    flack=flack+1
                else:
                    break
            else:
                if n[j]==s[i+j]:
                    flack=flack+1
                else:
                    break
    if flack==len(n):
        flag=1
        break
                
if flag:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

Solution code:
from collections import deque

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

    s = deque(S)
    n = len(S)
    for _ in range(n - 1):
        s.append(s.popleft())
        if P in ''.join(s):
            ans = 'Yes'
            break
    else:
        ans = 'No'

    print(ans)

main()

Submission status: Wrong Answer

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

S = s+s

index = S.find(str(p))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
z=input()
a=[]
for i in z:
    a+=i
ai=set(a)
b=[]
x=input()
for i in x:
    b+=i
bs=set(b)
print(bs <= ai)

Submission status: Wrong Answer

Solution code:
z=input()
a=[]
for i in z:
    a+=i
ai=set(a)
b=[]
x=input()
for i in x:
    b+=i
bs=set(b)
if bs<=ai:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
p=input()
print(s.find(p) != p)

Submission status: Wrong Answer

Solution code:
try:
  while True:
   s=input()
   p=input() 
   print(s.find(p) != p)
except: pass

Submission status: Wrong Answer

Solution code:
s=input()
p=input()
if s.find(p) != p:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
i=0
flg = False
ret = 'Yes'
p=input()
s=input() 
for a in s:
    p+=p[0:i]
    try: i=p[i:].index(a)
    except:
        flg = True
        break        
if flg: ret = 'No'
print(ret)

Submission status: Wrong Answer

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

bm = idx = 0
ep = len(p)
ret = 'Yes'

for a in s:
    temp = p[bm:ep] + p[0:bm]
    try:
        bm += temp.index(a)
        if bm > ep: bm -= ep
    except:
        ret = 'No'
        break
print(ret)

Submission status: Wrong Answer

Solution code:
z=input()*2
x=input()
a=z.count(x)
print(a)
if a>=1:
    print("Yes")
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
Ans = False

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -1
        if s[i + j] != p[j]:
            break
    if j == len(p) - 1:
        Ans = True
        break

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

Submission status: Wrong Answer

Solution code:
s = input()
p = input()
Ans = False

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -j
        if s[i + j] != p[j]:
            break
    if j == len(p) - 1:
        Ans = True
        break

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

Submission status: Wrong Answer

Solution code:
p,s=[input() for i in range(2)]
p=p*100
if s in p:
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s,p=[input() for i in range(2)]
s=s*100
if p in s:
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
letters=input()
letters=letters+letters
want_find=input()
print(letters)
if letters.find(want_find)>=0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
letters=input()
letters=letters+letters
want_find=input()
print(letters)
if want_find in letters:
    print('Yes')
else:
    print('No')