import itertools
n = int(input())
a = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))

able = [0] * (max(n * max(a) + 1, 2001))
for item in itertools.product([0, 1], repeat=n):
    total = sum([i * j for i, j in zip(a, item)])
    able[total] = 1

for m in M:
    print('yes' if able[m] else 'no')
 import itertools itertools n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input M = list(map(int, input().split())) M list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split able = [0] * (max(n * max(a) + 1, 2001)) able [0] * (max(n * max(a) + 1, 2001)) [0] 0 max(n * max(a) + 1, 2001) max n * max(a) + 1 n * max(a) n max(a) max a 1 2001 for item in itertools.product([0, 1], repeat=n):
    total = sum([i * j for i, j in zip(a, item)])
    able[total] = 1 item itertools.product([0, 1], repeat=n) itertools.product itertools product [0, 1] 0 1 repeat=n repeat n i * j for i, j in zip(a, item) for i, j in zip(a, item) i j zip(a, item) zip a item for i, j in zip(a, item) i * j i j total = sum([i * j for i, j in zip(a, item)]) total sum([i * j for i, j in zip(a, item)]) sum [i * j for i, j in zip(a, item)] able[total] = 1 able[total] able total 1 for m in M:
    print('yes' if able[m] else 'no') m M print('yes' if able[m] else 'no') print 'yes' if able[m] else 'no' able[m] able m 'yes' 'no' n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a able = [0] * (max(n * max(a) + 1, 2001)) [0] * (max(n * max(a) + 1, 2001)) able M = list(map(int, input().split())) list(map(int, input().split())) M q = int(input()) int(input()) q total = sum([i * j for i, j in zip(a, item)]) sum([i * j for i, j in zip(a, item)]) total
import itertools
n = int(input())
a = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))

able = [0] * (max(n * max(a) + 1, 2001))
for item in itertools.product([0, 1], repeat=n):
    total = sum([i * j for i, j in zip(a, item)])
    able[total] = 1

for m in M:
    print('yes' if able[m] else 'no')

