import sys
from itertools import product

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    M = list(map(int, input().split()))

    num = set()
    for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

    for m in M:
        print("yes" if m in num else "no")


if __name__ == '__main__':
    resolve()
 import sys sys from itertools import product sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline f_inf = float('inf') f_inf float('inf') float 'inf' mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    M = list(map(int, input().split()))

    num = set()
    for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

    for m in M:
        print("yes" if m in num else "no") resolve 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 num = set() num set() set for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

     pattern product([0, 1], repeat=n) product [0, 1] 0 1 repeat=n repeat n total = 0 total 0 for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
         idx p enumerate(pattern) enumerate pattern if p == 1:
                total += A[idx]
         p == 1 p 1 total += A[idx] total A[idx] A idx num.add(total) num.add num add total for m in M:
        print("yes" if m in num else "no") m M print("yes" if m in num else "no") print "yes" if m in num else "no" m in num m num "yes" "no" if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    M = list(map(int, input().split()))

    num = set()
    for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

    for m in M:
        print("yes" if m in num else "no") def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    M = list(map(int, input().split()))

    num = set()
    for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

    for m in M:
        print("yes" if m in num else "no") resolve f_inf = float('inf') float('inf') f_inf input = sys.stdin.readline sys.stdin.readline input mod = 10 ** 9 + 7 10 ** 9 + 7 mod
import sys
from itertools import product

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    M = list(map(int, input().split()))

    num = set()
    for pattern in product([0, 1], repeat=n):
        total = 0
        for idx, p in enumerate(pattern):
            if p == 1:
                total += A[idx]
        num.add(total)

    for m in M:
        print("yes" if m in num else "no")


if __name__ == '__main__':
    resolve()

