import bisect

n = int(eval(input()))

A = tuple(map(int,input().split()))

q = int(eval(input()))

Q = tuple(map(int, input().split()))

dp = [0]*(2**n)



for i in range(n):

    for j in range(1<<i):

        dp[j+(1<<i)] = dp[j] + A[i]

dp.sort()



for n in Q:

    i = bisect.bisect(dp, n)

    print(("yes" if i>0 and n==dp[i-1] else "no"))
def solve():

    from itertools import product

    input()

    A = tuple(map(lambda x: (0, int(x)), input().split()))

    result = [0]*(2000*20+1)

    for a in product(*A):

        result[sum(a)] = 1



    input()

    print(*("yes" if result[q] else "no" for q in map(int, input().split())), sep="\n")





if __name__ == "__main__":

    solve()

import bisect

n = int(eval(input()))
A = tuple(map(int, input().split()))
q = int(eval(input()))
Q = tuple(map(int, input().split()))
dp = [0] * (2**n)
for i in range(n):
    for j in range(1 << i):
        dp[j + (1 << i)] = dp[j] + A[i]
dp.sort()
for n in Q:
    i = bisect.bisect(dp, n)
    print(("yes" if i > 0 and n == dp[i - 1] else "no"))

def solve():
    from itertools import product

    input()
    A = tuple(map(lambda x: (0, int(x)), input().split()))
    result = [0] * (2000 * 20 + 1)
    for a in product(*A):
        result[sum(a)] = 1
    input()
    print(*("yes" if result[q] else "no" for q in map(int, input().split())), sep="\n")


if __name__ == "__main__":
    solve()

-import bisect +def solve(): +    from itertools import product -n = int(eval(input())) -A = tuple(map(int, input().split())) -q = int(eval(input())) -Q = tuple(map(int, input().split())) -dp = [0] * (2**n) -for i in range(n): -    for j in range(1 << i): -        dp[j + (1 << i)] = dp[j] + A[i] -dp.sort() -for n in Q: -    i = bisect.bisect(dp, n) -    print(("yes" if i > 0 and n == dp[i - 1] else "no")) +    input() +    A = tuple(map(lambda x: (0, int(x)), input().split())) +    result = [0] * (2000 * 20 + 1) +    for a in product(*A): +        result[sum(a)] = 1 +    input() +    print(*("yes" if result[q] else "no" for q in map(int, input().split())), sep="\n") + + +if __name__ == "__main__": +    solve()