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]))

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'))

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]))

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"))

-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()) +s = {0} +for a in map(int, input().split()): +    for b in list(s): +        s.add(a + b) -    print((["no", "yes"][e in r])) +    print(("yes" if e in s else "no"))