s = input()
n = int(input())
d = set()
for i in range(n):
    d.add(input())
ans = 0
for j in range(6, 11):
    for i in range(len(s)-j):
        if s[i:(i+j)] in d: ans += 1

if ans >= len(s)//10: print("yes")
else: print("no")
