Not everyone probably knows that Chef has younder brother Jeff. Currently Jeff learns to read.
He knows some subset of the letter of Latin alphabet. In order to help Jeff to study, Chef gave him a book with the text consisting of N words. Jeff can read a word iff it consists only of the letters he knows.
Now Chef is curious about which words his brother will be able to read, and which are not. Please help him!

-----Input-----
The first line of the input contains a lowercase Latin letter string S, consisting of the letters Jeff can read. Every letter will appear in S no more than once.
The second line of the input contains an integer N denoting the number of words in the book.
Each of the following N lines contains a single lowecase Latin letter string Wi, denoting the ith word in the book.

-----Output-----
For each of the words, output "Yes" (without quotes) in case Jeff can read it, and "No" (without quotes) otherwise.

-----Constraints-----
- 1 ≤ |S| ≤ 26
- 1 ≤ N ≤ 1000
- 1 ≤ |Wi| ≤ 12
- Each letter will appear in S no more than once.
- S, Wi consist only of lowercase Latin letters.

-----Subtasks-----
- Subtask #1 (31 point): |S| = 1, i.e. Jeff knows only one letter.
- Subtask #2 (69 point)	: no additional constraints

-----Example-----
Input:act
2
cat
dog

Output:Yes
No

-----Explanation-----
The first word can be read.
The second word contains the letters d, o and g that aren't known by Jeff.

Difficulty: interview

Starter code:

Solutions:
knows=input()
n=eval(input())
while n!=0:
 n=n-1
 word=input()
 for x in word:
  ctr=0
  for y in knows:
   if x==y:ctr=ctr+1;break
  if ctr==0:print('No');break
 else: print('Yes')

import collections

def alphabet():
 s = input()
 d = collections.defaultdict(lambda : 0)
 for i in s:
  d[i]+=1
 n = int(input())
 for i in range(n):
  w = input()
  flag = True
  for i in w:
   if i not in d:
    print("No")
    flag = False
    break
  if flag:
   print("Yes")


alphabet()



import collections

def alphabet():
 s = input()
 d = collections.defaultdict(lambda : 0)
 for i in s:
  d[i]+=1
 n = int(input())
 for i in range(n):
  w = input()
  flag = True
  for i in w:
   if i not in d:
    print("No")
    flag = False
    break
  if flag:
   print("Yes")


alphabet()



s1 = input()
for i in range(int(input())):
 s2 = input()
 a= ''.join(sorted(s1))
 c= ''.join(set(s2))
 b= ''.join(sorted(c))
 if b in a and len(b)<=len(a):
  print('Yes')
 else:
  print('No')

s1 = input()
for i in range(int(input())):
 s2 = input()
 a= ''.join(sorted(s1))
 c= ''.join(set(s2))
 b= ''.join(sorted(c))
 if b in a and len(c)<=len(a):
  print('Yes')
 else:
  print('No')

s1 = input()
for i in range(int(input())):
 s2 = input()
 a= ''.join(sorted(s1))
 c= ''.join(set(s2))
 b= ''.join(sorted(c))
 if b in a:
  print('Yes')
 else:
  print('No')

s = input()
n = eval(input())
for i in range(n):
 w = input()
 cnt = 0
 for j in range(len(w)):
  if(w[j] in s):
   cnt+=1
  
 if(cnt == len(w)):
  print("Yes")
 else:
  print("No")

# book = ''.join(sorted(str(raw_input())))
book = input()


for i in range(0, int(input())):
 words = str(input())
 check = 0
 for letter in sorted(words):
  if letter in book:
   check = check + 1

 if check == len(words):
  print("Yes")
 else:
  print("No")


# cook your code here
alf = input()

n = int(input())
for _ in range(n):
 yes = 1
 x = input()
 for c in x:
  if(alf.find(c) == -1):
   yes = 0
   break
 if yes:print("Yes")
 else:print("No")

l1 = input().lower()
lang_set = set([x.lower() for x in l1 if x.isalpha() ])
l2 = set([x for x in l1 if l1.count(x)>1])

no_cases = int(input())
# if(len(l2)>0):
#     for i in xrange(no_cases):
#         word = raw_input()
#         print "No"
# else :
for i in range(no_cases):
 word = input().lower()
 word_set = set([x.lower() for x in word if x.isalpha() ])
 fl =word_set.issubset(lang_set)
 if(fl) :
  print("Yes")
 else :
  print("No")


def correct_string(s):
 a = set(s)
 if len(a) == len(s):
  return 1
 return 0

s = input()
if correct_string(s):
 s = sorted(s)
 s1 = "".join(s)
 n = int(input())
 if (n >= 1 and n <= 1000):
  for x in range(0,n):
   v = input()
   v = set(v)
   lw = len(v)
   if lw >= 1 and lw <= 12:
    v = sorted(v)
    s2 = "".join(v)
    if s1 == s2:
     print("Yes")
    else:
     print("No")
   pass

s = input()
n = int(input())
t = []
for _ in range(n):
 a = input()
 t.append(a)

for i in t:
 flag = True
 for j in i:
  if j not in s:
   flag = False
   break
 if(flag):
  print("Yes")
 else:
  print("No")


s=input().lower()
for _ in range(int(input())):
 st=input().lower()
 
 if(set(st)==set(s)):
  print("Yes")
 else:
  print("No")
 
  
 
 


s = input()
n = int(input())

def find_str(word):
 nonlocal s
 for i in word:
  if i in s:
   pass
  else:
   return "No"
 return "Yes"

while n :
 w = input()
 print(find_str(w))
 n = n - 1

l=input()
n=int(input())
for i in range(n):
 flag=0
 s=input()
 for j in range(len(s)):
  if(s[j] in l):
   flag=flag+1
 if(flag==len(s)):
  print("Yes")
 else:
  print("No")

s = [0]*26
q = input()
for i in q:
 s[ord(i)-97] = 1
n = int(input())
while(n):
 e = input()
 f = 1
 for i in e:
  if not (s[ord(i)-97]):
   f = 0
   break
 if(f):
  print("Yes")
 else:
  print("No")
 n -= 1

letters=input()
n=int(input())
words=list()

for i in range(n):
 word=input()
 words.append(word)

for word in words:
 l=list(word)
 i=0
 for letter in l:
  if letter in letters:
   continue
  else:
   print("No")
   i=1
   break

 if i==0:
  print("Yes")
 i=0


s=input()
for _ in range(int(input())):
 st=input()
 if(s.islower() and st.islower()):
  if(set(st)==set(s)):
   print("Yes")
  else:
   print("No")
 else:
  print("No")


S = input()
N = int(input())
while N != 0:
 W = input()
 flag = 0
 for i in range(0, len(W)):
  if W[i] in S:
   continue
  else:
   flag = 1
   break
 if flag == 0:
  print("Yes")
 else:
  print("No")
 N -= 1