CodeEff/ECCO huggingface dataset:
# Original solution
def solve(i, m):
    if m == 0:
        return True
    if i == n:
        return False
    return solve(i+1, m) or solve(i+1, m-A[i])


if __name__ == "__main__":
    n = int(eval(input()))
    A = list(map(int, input().split()))
    q = int(eval(input()))
    M = list(map(int, input().split()))
    for m in M:
        if solve(0, m):
            print("yes")
        else:
            print("no")

# Optimized solution
import itertools


def rev(x):
    return sumA - x


if __name__ == "__main__":
    n = int(eval(input()))
    A = list(map(int, input().split()))
    q = int(eval(input()))
    M = list(map(int, input().split()))
    sumA = sum(A)
    all_sum = set()
    for i in range((n+1)//2):
        com = set(itertools.combinations(A, i+1))
        com_sum = set(map(sum, com))
        com_sum_rev = set(map(rev, com_sum))
        all_sum = all_sum.union(com_sum)
        all_sum = all_sum.union(com_sum_rev)
    for m in M:
        if m in all_sum:
            print("yes")
        else:
            print("no")
# Original solution
n1 = int(input())
A = list(map(int, input().split()))
n2 = int(input())
q = list(map(int, input().split()))

B = []

n = n1
ans = list("no" for i in range(n2))

for i in range(2 ** n):
    C0 = []
    B = list(map(int, format(i, "b").zfill(n)))[::-1]
    C0 = [ x*y for x, y in zip(A, B)]
    C = sum(C0)
    for j, r in enumerate(q):
        if  C == r:
            ans[j] = "yes"
print(*ans, sep="\n")


# Optimized solution
n1 = int(input())
A = list(map(int, input().split()))
n2 = int(input())
q = list(map(int, input().split()))

B = []
C = []
n = n1
ans = list("no" for i in range(n2))

for i in range(2 ** n):
    C0 = []
    B = list(map(int, format(i, "b").zfill(n)))[::-1]
    C0 = [ x*y for x, y in zip(A, B)]
    C.append(sum(C0))

for j, r in enumerate(q):    
    if  r in C:
        ans[j] = "yes"

print(*ans, sep="\n")
# Original solution
n = int(eval(input()))
A = list(map(int, input().split() ))
q = int(eval(input()))
m = list(map(int, input().split()))

def solve(i, m):
    if m == 0:
        return True
    elif i >= n:
        return False
    else:
        return solve(i+1, m) or solve(i+1, m - A[i])
    

for num in m:
    print(('yes' if solve(0, num) else 'no'))



# Optimized solution
# used DP

n = int(eval(input()))
A = list(map(int, input().split() ))
q = int(eval(input()))
M = list(map(int, input().split()))


dp = [[None]*(max(M)+1) for i in range(n)]

# we refer to the list dp only when i = 0, 1, ... , n-1 and m >= 0.
def solve(i, m):    
    if i >= n:
        return m == 0
    
    elif m < 0:
        return False
    
    elif dp[i][m] is not None:
        return dp[i][m]
    
    else:
        if m == 0:
            dp[i][m] = True
        elif solve(i+1, m):
            dp[i][m] = True
        elif solve(i+1, m - A[i]):
            dp[i][m] = True
        else:
            dp[i][m] =  False        
        return dp[i][m]

    
for num in M:
    print(('yes' if solve(0, num) else 'no'))
# Original solution
n = int(input())
A = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

def solve(i, m):
    if m == 0:
        return 1
    if i >= n:
        return 0
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res
        
for j in range(0, q):
    if solve(0, m[j]):
        print("yes")
    else:
        print("no")

# Optimized solution
n = int(input())
A = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

def solve(i, m):
    if m == 0:
        return 1
    if i >= n or m > sum(A):
        return 0
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res
        
for j in range(0, q):
    if solve(0, m[j]):
        print("yes")
    else:
        print("no")
# Original solution
# -*- coding: utf-8 -*-

def func(i, m):
    if m == 0:
        return True
    elif m < 0 or i >= len(A):
        return False
    else:
        if func(i+1, m-A[i]):
            return True
        if func(i+1, m):
            return True
    return False

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
for i in range(q):
    if func(0, M[i]):
        print("yes")
    else:
        print("no")

# Optimized solution
# -*- coding: utf-8 -*-

n = int(input())
A = {0}
for c in input().split():
    for i in A.copy():
        A.add(i+int(c))
q = int(input())
M = list(map(int, input().split()))
for m in M:
    if m in A:
        print("yes")
    else:
        print("no")
# Original solution
class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node


def run_tree():
    _ = int(eval(input()))  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(eval(input()))  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no")



if __name__ == '__main__':
    run_tree()



# Optimized solution
def create_sums(ns):
    if len(ns) == 0:
        return set()

    s = create_sums(ns[1:])
    return {e + ns[0] for e in s} | s | {ns[0]}


def run_set():
    _ = int(eval(input()))  # flake8: noqa
    ns = [int(i) for i in input().split()]

    sums = create_sums(ns)
    _ = int(eval(input()))  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if q in sums:
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    run_set()
# Original solution
def solve(i, m):
    if m == 0: return True
    if i == n or m < 0:
        return False

    r1 = solve(i + 1, m)
    r2 = solve(i + 1, m - A[i])

    return r1 or r2


n = int(input())
A = list(map(int, input().split()))

q = int(input())
M = list(map(int, input().split()))

for i in M:
    print("yes" if solve(0, i) else "no")

# Optimized solution
def solve(i, m):
    if m == 0: return True

    if i < n and min(A[i:]) <= m <= sum(A[i:]):
        r1 = solve(i + 1, m-A[i])
        if r1: return r1
        r2 = solve(i + 1, m)
        if r2: return r2


n = int(input())
A = list(map(int, input().split()))

q = int(input())
M = list(map(int, input().split()))

for i in M:
    print("yes" if solve(0, i) else "no")
# Original solution
import sys
import itertools

def can_be_composed(n, m, A):
	for i in range(1, n + 1):
		combination_list = list(itertools.combinations(A, i))
		for l in combination_list:
			if m == sum(l):
				return True

	return False

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
A = list(map(int, fin.readline().split()))
q = int(fin.readline())
m_list = list(map(int, fin.readline().split()))
for m in m_list:
	if can_be_composed(n, m, A):
		print("yes")
	else:
		print("no")

# Optimized solution
import sys
import itertools

def can_be_composed(n, min_list, max_list, m, A):
	for i in range(1, n + 1):
		if m < min_list[i - 1]:
			continue
		if m > max_list[i - 1]:
			continue

		combination_list = list(itertools.combinations(A, i))
		for l in combination_list:
			if m == sum(l):
				return True

	return False

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
A = list(map(int, fin.readline().split()))
A.sort()
q = int(fin.readline())
m_list = list(map(int, fin.readline().split()))

min_list = [0]
min_list[0] += A[0]
for i in range(1, n):
	min_list.append(min_list[i - 1] + A[i])

max_list = [0]
max_list[0] += A[n - 1]
for i in range(1, n):
	max_list.append(max_list[i - 1] + A[n - i - 1])

for m in m_list:
	if can_be_composed(n, min_list, max_list, m, A):
		print("yes")
	else:
		print("no")
# Original solution
n=int(eval(input()))
A=list(map(int,input().split()))
r=set()
def f(s,k):
    if k>=0:
        global r
        r.add(s)
        f(s+A[k-1],k-1)
        f(s,k-1)
f(0,n)
eval(input())
for e in map(int,input().split()):print((['no','yes'][e in r]))


# Optimized solution
eval(input())
s = {0}
for a in map(int,input().split()):
    for b in list(s):
        s.add(a+b)
eval(input())
for e in map(int,input().split()):
    print(('yes' if e in s else 'no'))
# Original solution
# -*- coding: utf-8 -*-

"""
全探索
・再帰で作る
"""

N = int(eval(input()))
aN = list(map(int, input().split()))
Q = int(eval(input()))
mQ = list(map(int, input().split()))

def dfs(cur, depth, ans):
    # 終了条件
    if cur == ans:
        return True
    # 全探索
    for i in range(depth, N):
        if dfs(cur+aN[i], i+1, ans):
            return True
    # 見つからなかった
    return False

for i in range(Q):
    if dfs(0, 0, mQ[i]):
        print('yes')
    else:
        print('no')



# Optimized solution
# -*- coding: utf-8 -*-

"""
全探索
・再帰で作る
・2^20でTLEするからメモ化した
"""

N = int(eval(input()))
aN = list(map(int, input().split()))
Q = int(eval(input()))
mQ = list(map(int, input().split()))

def dfs(cur, depth, ans):
    # 終了条件
    if cur == ans:
        return True
    # memo[現在位置]に数値curがあれば、そこから先はやっても同じだからやらない
    if cur in memo[depth]:
        return False
    memo[depth].add(cur)
    # 全探索
    for i in range(depth, N):
        if dfs(cur+aN[i], i+1, ans):
            return True
    # 見つからなかった
    return False

for i in range(Q):
    memo = [set() for j in range(N+1)]
    if dfs(0, 0, mQ[i]):
        print('yes')
    else:
        print('no')
# Original solution
num_n = eval(input())
N = list(map(int, input().split()))
num_m = eval(input())
M = list(map(int, input().split()))
   
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
    
for m in M:
   if solve(0, m):
      print("yes")
   else:
      print("no")

# Optimized solution
num_n = int(eval(input()))
n = list(map(int, input().split()))
num_m = int(eval(input()))
m = list(map(int, input().split()))
    
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
     
for k in range(num_m):
   if solve(0, m[k]):
      print("yes")
   else:
      print("no")
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
????????????
?????? n ?????°??? A ??¨??´??° m ???????????????A ???????´?????????????????????????????´?????¶????????????????
m ???????????????????????????????????????????????°????????????????????????????????????
AA ??????????´???????????????????????????¨?????§????????????

??°??? A ??????????????????????????§???????????¨?????? q ?????? mi ????????????????????§???
???????????????????????? "yes" ????????? "no" ??¨???????????????????????????

n ??? 20 ; q ??? 200 ; 1 ??? A???????´? ??? 2000 ; 1 ??? Mi ??? 2000

"""
def kenzan(m, n, A):

    if m < A[0]:
        return -1

    # ?????????????????§????????°???????????£????????????
    total = 0
    nA = []
    for i in range(n):
        if A[i] == m:
            return 0
#        print("{} m:{} x:{} total:{}".format(nA,m,A[i], total))
        if A[i] > m:
            break
        nA.append(A[i])
        total += A[i]

    if m > total:
        return -1

    n =len(nA)
    l = 2 ** n
    for i in range(1,l):
        c = 0
        bi = "{0:0<{width}b}".format(i,width=n)
        bi = bi[::-1]
#        print("{0:2}[{1}] m[{2:4}] {3}".format(i, bi,m, n))
        for j in range(n):
#            print("\tj:{} bi:{} Aj[{:4}]".format(j, bi[j], A[j]))
            if bi[j] == "1":
                x = c + nA[j]
#                print("\tm[{:4}] c+Aj[{:4}] c[{:4}] j:{} Aj[{:4}]".format(m, x, c, j, A[j]))
                if x == m:
                    return 0
                elif x > m:
#                    print("BAD")
                    break
                else:
                    c = x
    return -1
 
def main():
    """ ????????? """
    n = int(eval(input()))
    A = sorted(map(int,input().split()))
    q = int(eval(input()))
    M = list(map(int,input().split()))

    for i in range(q):

        if kenzan(M[i], n, A) == 0:
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    main()

# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
????????????
?????? n ?????°??? A ??¨??´??° m ???????????????A ???????´?????????????????????????????´?????¶????????????????
m ???????????????????????????????????????????????°????????????????????????????????????
AA ??????????´???????????????????????????¨?????§????????????

??°??? A ??????????????????????????§???????????¨?????? q ?????? mi ????????????????????§???
???????????????????????? "yes" ????????? "no" ??¨???????????????????????????

n ??? 20 ; q ??? 200 ; 1 ??? A???????´? ??? 2000 ; 1 ??? Mi ??? 2000

"""

def main():
    """ ????????? """
    n = int(eval(input()))
    A = sorted(map(int,input().split()))
    q = int(eval(input()))
    M = list(map(int,input().split()))
    g = 0

    tA = []
    l = 2 ** n
    for i in range(1,l):
        c = 0
        bi = "{0:0{width}b}".format(i,width=n)
        bi = bi[::-1]
        for j in range(n):
            if bi[j] == "1":
                c += A[j]
        tA.append(c)
#    tA.sort()

    for mi in M:
        if mi in tA:
            print("yes")
        else:
            print("no")

if __name__ == '__main__':
    main()
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a
@author: maezawa
"""
import itertools as itr

n = int(eval(input()))
a = list(map(int, input().split()))
q = int(eval(input()))
m = list(map(int, input().split()))

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        sum_array.append(sum(comb))

for i in m:
    yesorno = 'no'
    for j in sum_array:
        #print(i, j)
        if i == j:
            yesorno = 'yes'
            break
    print(yesorno)



# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a_r1  
@author: maezawa
"""
import itertools as itr

n = int(eval(input()))
a = list(map(int, input().split()))
q = int(eval(input()))
m = list(map(int, input().split()))

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        sum_array.append(sum(comb))
sum_array.sort()

for i in m:
    left = 0
    right = len(sum_array)
    yesorno = 'no'
    while(left < right):
        #print(left, right)
        mid = (left+right)//2
        if sum_array[mid] == i:
            yesorno = 'yes'
            break
        elif sum_array[mid] > i:
            right = mid
        else:
            left = mid+1
            
    print(yesorno)
# Original solution
import time
from array import array

def solve(i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    return solve(i+1, m) or solve(i+1, m-A[i])

if __name__ == '__main__':
    n = int(input())
    A = array('I', list(map(int, input().split())))
    q = int(input())
    m = array('I', list(map(int, input().split())))

    start = time.time()
    for m_i in m:
        print("yes" if solve(0, m_i) else "no")
    end = time.time()
    #print end - start

# Optimized solution
import time

def sequence(A, n):
    dic = {}
    
    def solve(i, m):
        if (i, m) in dic:
            return dic[(i, m)]
        if m == 0:
            dic[(i, m)] = True
        elif i >= n:
            dic[(i, m)] = False
        elif solve(i+1, m):
            dic[(i, m)] = True
        elif solve(i+1, m-A[i]):
            dic[(i, m)] = True
        else:
            dic[(i, m)] = False
        return dic[(i, m)]
    
    return solve

if __name__ == '__main__':
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))

    #start = time.time()
    solve = sequence(A, n)
    for m_i in m:
        print("yes" if solve(0, m_i) else "no")
    #end = time.time()
    #print end - start
# Original solution
import itertools

numA = int(input().rstrip())
listA = list(map(int,input().rstrip().split(" ")))
numQ = int(input().rstrip())
listQ = list(map(int,input().rstrip().split(" ")))

sumA = []
cnt = 0


for i in range(1,numA+1):
    tmpComb = list(itertools.combinations(listA, i))
    for nums in tmpComb:
        sumA.append(sum(nums))


for i in range(numQ):
    if sumA.count(listQ[i]) > 0:
        print("yes")
    else:
        print("no")

# Optimized solution
import itertools
 
numA = int(input().rstrip())
listA = list(map(int,input().rstrip().split(" ")))
numQ = int(input().rstrip())
listQ = list(map(int,input().rstrip().split(" ")))
 
sumA = set([])
cnt = 0
 
 
for i in range(1,numA+1):
    tmpComb = list(itertools.combinations(listA, i))
    for nums in tmpComb:
        sumA.add(sum(nums))
 
 
for i in range(numQ):
    if listQ[i] in sumA:
        print("yes")
    else:
        print("no")
# Original solution
# coding: utf-8
N = int(eval(input()))
A = [int(i) for i in input().split()]
q = int(eval(input()))
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
#i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    #終了条件
    if m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        #全探索かっこわるい
        return fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])
 
for i in m:
    print(("yes" if fullSearch(0, i) else "no"))

# Optimized solution
# coding: utf-8
N = int(eval(input()))
A = [int(i) for i in input().split()]
q = int(eval(input()))
m = [int(i) for i in input().split()]
MAX_LENGTH = len(A)
dp = [[-1 for i in range(max(m) + 1)] for j in range(MAX_LENGTH + 1)]
# i番目以降の値を使ってmを作ればTrueを返す
def fullSearch(i, m):
    # 終了条件
    if m < 0:
        return False
    elif dp[i][m] != -1:
        return dp[i][m]
    elif m == 0:
        return True
    elif i >= MAX_LENGTH:
        return False
    else:
        # 全探索かっこわるい
        res = fullSearch(i + 1, m) or fullSearch(i + 1, m - A[i])
    # のでメモ化
    dp[i][m] = res
    return res
for mi in m:
    print(("yes" if fullSearch(0, mi) else "no"))
# Original solution
import itertools as it
    
n = int(eval(input()))
A = list(map(int, input().split()))
q = int(eval(input()))
m = list(map(int, input().split()))

s = set()

for i in range(n):
    li= list(it.combinations(A, i+1))
    for j in range(len(li)):
        s.add(sum(li[j]))

for k in range(q):
    print(('yes' if m[k] in s else 'no'))

# Optimized solution
from itertools import combinations

n = int(eval(input()))
A = list(map(int, input().split()))
q = int(eval(input()))
m = list(map(int, input().split()))

l = set(sum(t) for i in range(n) for t in combinations(A, i+1))

for j in m:
    print(('yes' if j in l else 'no'))
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))
q = int(eval(input()))
M = list(map(int, input().split()))

def solve(i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res
for m in M:
    if solve(0, m):
        print('yes')
    else:
        print('no')

# Optimized solution
n = int(eval(input()))
A = list(map(int, input().split()))
q = int(eval(input()))
M = list(map(int, input().split()))

memo = {}
def solve(i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    if memo.get((i, m), None) == None:
        memo[(i, m)] = solve(i + 1, m) or solve(i + 1, m - A[i])
    return memo[(i, m)]
for m in M:
    if solve(0, m):
        print('yes')
    else:
        print('no')
# Original solution
# coding=utf-8

def solve(i, m):
    global A
    if m == 0:
        ever_calc[i][m] = True
        return True
    elif m < 0:
        ever_calc[i][m] = False
        return False
    elif i == n:
        ever_calc[i][m] = False
        return False
    else:
        result = (solve(i+1, m) or solve(i+1, m-A[i]))
        ever_calc[i][m] = result
        return result

n = int(eval(input()))
A = tuple(map(int, input().split()))
q = int(eval(input()))
M = tuple(map(int, input().split()))
sum_A = sum(A)
ever_calc = [[None] * 2000 for i in range(n+1)]

for m in M:
    if m > sum_A:
        print('no')
    elif solve(0, m):
        print('yes')
    else:
        print('no')

# Optimized solution
# coding=utf-8

def solve(i, m):
    global A
    if ever_calc[i][m] != None:
        return ever_calc[i][m]
    if m == 0:
        ever_calc[i][m] = True
        return True
    elif m < 0:
        ever_calc[i][m] = False
        return False
    elif i == n:
        ever_calc[i][m] = False
        return False
    else:
        result = (solve(i+1, m) or solve(i+1, m-A[i]))
        ever_calc[i][m] = result
        return result

n = int(eval(input()))
A = tuple(map(int, input().split()))
q = int(eval(input()))
M = tuple(map(int, input().split()))
sum_A = sum(A)
ever_calc = [[None] * 2000 for i in range(n+1)]

for m in M:
    if m > sum_A:
        print('no')
    elif solve(0, m):
        print('yes')
    else:
        print('no')
# Original solution
import sys

def exhaustiveSearch(A, m):
    for i in range(len(A)):
        if m == A[i]:
            return True
        elif m > A[i]:
            if exhaustiveSearch(A[:i] + A[i + 1:], m -  A[i]):
                return True
    return False

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    A = list(map(int, lines[1].split()))
    M = list(map(int, lines[3].split()))

    for m in M:
        if exhaustiveSearch(A, m):
            print("yes")
        else:
            print("no")

# Optimized solution
import sys

def exhaustiveSearch(A, m):
    if len(A) == 1 and A[0] != m:
        return False
    elif A[0] == m:
        return True
    return exhaustiveSearch(A[1:], m) or exhaustiveSearch(A[1:], m - A[0])

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    A = list(map(int, lines[1].split()))
    M = list(map(int, lines[3].split()))

    for m in M:
        if exhaustiveSearch(A, m):
            print("yes")
        else:
            print("no")
# Original solution
import sys

def exhaustiveSearch(A, m):
    if len(A) == 1 and A[0] != m or m < 0:
        return False
    elif A[0] == m:
        return True
    return exhaustiveSearch(A[1:], m) or exhaustiveSearch(A[1:], m - A[0])

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    A = list(map(int, lines[1].split()))
    M = list(map(int, lines[3].split()))

    for m in M:
        if exhaustiveSearch(A, m):
            print("yes")
        else:
            print("no")

# Optimized solution
import sys

def exhaustiveSearch(A, m, i):
    if A[i] == m:
        return True
    elif i == len(A) - 1:
        return False

    return exhaustiveSearch(A, m, i + 1) or exhaustiveSearch(A, m - A[i], i + 1)

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    A = list(map(int, lines[1].split()))
    M = list(map(int, lines[3].split()))

    for m in M:
        if exhaustiveSearch(A, m, 0):
            print("yes")
        else:
            print("no")