def subset_sum(s, a):

	dict = {}

	return subset_rec(0, s, a, dict)

	

def subset_rec(i, s, a, dict):

	key = str(i) + '-' + str(s)

	if key in dict:

		ret = dict[key]

	elif s == 0:

		ret = True

	elif i >= len(a):

		ret =  False

	else:

		ret = subset_rec(i+1, s-a[i], a, dict) or subset_rec(i+1, s, a, dict)

	dict[key] = ret

	return ret



n = int(eval(input()))

a = list(map(int, input().split()))

p = int(eval(input()))

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

for i in range(p):

	if subset_sum(q[i], a):

		print('yes')

	else:

		print('no')



def subset_sum(s, a):

	n = len(a)

	dp = [[False for x in range(s+1)] for x in range(n+1)]

	for i in range(n):

		v = a[i]

		for j in range(s+1):

			if v == j:

				dp[i+1][j] = True

			elif v > j:

				dp[i+1][j] = dp[i][j]

			else:

				dp[i+1][j] = dp[i][j] or dp[i][j-v]

	return dp[n][s]



n = int(eval(input()))

a = list(map(int, input().split()))

q = int(eval(input()))

m = list(map(int, input().split()))

for i in range(q):

	if subset_sum(m[i], a) == True:

		print('yes')

	else:

		print('no')

def subset_sum(s, a):
    dict = {}
    return subset_rec(0, s, a, dict)


def subset_rec(i, s, a, dict):
    key = str(i) + "-" + str(s)
    if key in dict:
        ret = dict[key]
    elif s == 0:
        ret = True
    elif i >= len(a):
        ret = False
    else:
        ret = subset_rec(i + 1, s - a[i], a, dict) or subset_rec(i + 1, s, a, dict)
    dict[key] = ret
    return ret


n = int(eval(input()))
a = list(map(int, input().split()))
p = int(eval(input()))
q = list(map(int, input().split()))
for i in range(p):
    if subset_sum(q[i], a):
        print("yes")
    else:
        print("no")

def subset_sum(s, a):
    n = len(a)
    dp = [[False for x in range(s + 1)] for x in range(n + 1)]
    for i in range(n):
        v = a[i]
        for j in range(s + 1):
            if v == j:
                dp[i + 1][j] = True
            elif v > j:
                dp[i + 1][j] = dp[i][j]
            else:
                dp[i + 1][j] = dp[i][j] or dp[i][j - v]
    return dp[n][s]


n = int(eval(input()))
a = list(map(int, input().split()))
q = int(eval(input()))
m = list(map(int, input().split()))
for i in range(q):
    if subset_sum(m[i], a) == True:
        print("yes")
    else:
        print("no")

-    dict = {} -    return subset_rec(0, s, a, dict) - - -def subset_rec(i, s, a, dict): -    key = str(i) + "-" + str(s) -    if key in dict: -        ret = dict[key] -    elif s == 0: -        ret = True -    elif i >= len(a): -        ret = False -    else: -        ret = subset_rec(i + 1, s - a[i], a, dict) or subset_rec(i + 1, s, a, dict) -    dict[key] = ret -    return ret +    n = len(a) +    dp = [[False for x in range(s + 1)] for x in range(n + 1)] +    for i in range(n): +        v = a[i] +        for j in range(s + 1): +            if v == j: +                dp[i + 1][j] = True +            elif v > j: +                dp[i + 1][j] = dp[i][j] +            else: +                dp[i + 1][j] = dp[i][j] or dp[i][j - v] +    return dp[n][s] -p = int(eval(input())) -q = list(map(int, input().split())) -for i in range(p): -    if subset_sum(q[i], a): +q = int(eval(input())) +m = list(map(int, input().split())) +for i in range(q): +    if subset_sum(m[i], a) == True: