N = int(eval(input()))

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

Q = int(eval(input()))

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



combinations = {}



def create_combinations(idx, sum):

    combinations[sum] = 1

    if idx >= N:

        return

    create_combinations(idx+1, sum)

    create_combinations(idx+1, sum+A[idx])

    return



create_combinations(0, 0)



for target in M:

    if target in list(combinations.keys()):

        print("yes")

    else:

        print("no")

def solve(dp, a, i, m):

  if m in dp[i]:

    return dp[i][m]



  if m == 0:

    dp[i][m] = True

  elif i >= len(a):

    dp[i][m] = False

  elif solve(dp, a, i+1, m):

    dp[i][m] = True

  elif solve(dp, a, i+1, m-a[i]):

    dp[i][m] = True

  else:

    dp[i][m] = False



  return dp[i][m]



N = int(eval(input()))

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

Q = int(eval(input()))

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



dp = {}

for i in range(N+1):

  dp[i] = {}



for m in M:

  if solve(dp, A, 0, m):

    print('yes')

  else:

    print('no')

N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
M = list(map(int, input().split()))
combinations = {}


def create_combinations(idx, sum):
    combinations[sum] = 1
    if idx >= N:
        return
    create_combinations(idx + 1, sum)
    create_combinations(idx + 1, sum + A[idx])
    return


create_combinations(0, 0)
for target in M:
    if target in list(combinations.keys()):
        print("yes")
    else:
        print("no")

def solve(dp, a, i, m):
    if m in dp[i]:
        return dp[i][m]
    if m == 0:
        dp[i][m] = True
    elif i >= len(a):
        dp[i][m] = False
    elif solve(dp, a, i + 1, m):
        dp[i][m] = True
    elif solve(dp, a, i + 1, m - a[i]):
        dp[i][m] = True
    else:
        dp[i][m] = False
    return dp[i][m]


N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
M = list(map(int, input().split()))
dp = {}
for i in range(N + 1):
    dp[i] = {}
for m in M:
    if solve(dp, A, 0, m):
        print("yes")
    else:
        print("no")

+def solve(dp, a, i, m): +    if m in dp[i]: +        return dp[i][m] +    if m == 0: +        dp[i][m] = True +    elif i >= len(a): +        dp[i][m] = False +    elif solve(dp, a, i + 1, m): +        dp[i][m] = True +    elif solve(dp, a, i + 1, m - a[i]): +        dp[i][m] = True +    else: +        dp[i][m] = False +    return dp[i][m] + + -combinations = {} - - -def create_combinations(idx, sum): -    combinations[sum] = 1 -    if idx >= N: -        return -    create_combinations(idx + 1, sum) -    create_combinations(idx + 1, sum + A[idx]) -    return - - -create_combinations(0, 0) -for target in M: -    if target in list(combinations.keys()): +dp = {} +for i in range(N + 1): +    dp[i] = {} +for m in M: +    if solve(dp, A, 0, m):