s = input()
n = int(input())
d = set()
for i in range(n):
    d.add(input())
ans = 0
counts = []
for j in range(ord('a'), ord('z')+1):
    counts.append(s.count(chr(j)))


if min(counts) < len(s)//26 - 3.5*(len(s)//26)**0.5: print("yes")
else: print("no")
