from typing import List


def rec(i: int, tmp_sum: int, A_list: List[int], sum_list: List[bool]):
    if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

    rec(i + 1, tmp_sum + A_list[i], A_list, sum_list)
    rec(i + 1, tmp_sum, A_list, sum_list)


def main():
    n = int(input())
    A_list = list(map(int, input().split()))
    q = int(input())
    m_list = list(map(int, input().split()))

    sum_list = [False for _ in range(2001)]

    rec(0, 0, A_list, sum_list)

    for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no")


if __name__ == "__main__":
    main()
 from typing import List def rec(i: int, tmp_sum: int, A_list: List[int], sum_list: List[bool]):
    if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

    rec(i + 1, tmp_sum + A_list[i], A_list, sum_list)
    rec(i + 1, tmp_sum, A_list, sum_list) rec if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

     tmp_sum > 2000 tmp_sum 2000 return elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

     i == len(A_list) i len(A_list) len A_list sum_list[tmp_sum] = True sum_list[tmp_sum] sum_list tmp_sum True return rec(i + 1, tmp_sum + A_list[i], A_list, sum_list) rec i + 1 i 1 tmp_sum + A_list[i] tmp_sum A_list[i] A_list i A_list sum_list rec(i + 1, tmp_sum, A_list, sum_list) rec i + 1 i 1 tmp_sum A_list sum_list i: int i tmp_sum: int tmp_sum A_list: List[int] A_list sum_list: List[bool] sum_list def main():
    n = int(input())
    A_list = list(map(int, input().split()))
    q = int(input())
    m_list = list(map(int, input().split()))

    sum_list = [False for _ in range(2001)]

    rec(0, 0, A_list, sum_list)

    for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no") main n = int(input()) n int(input()) int input() input A_list = list(map(int, input().split())) A_list 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 = list(map(int, input().split())) m_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split False for _ in range(2001) for _ in range(2001) _ range(2001) range 2001 for _ in range(2001) False sum_list = [False for _ in range(2001)] sum_list [False for _ in range(2001)] rec(0, 0, A_list, sum_list) rec 0 0 A_list sum_list for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no") m m_list if sum_list[m]:
            print("yes")
        else:
            print("no") sum_list[m] sum_list m print("yes") print "yes" print("no") print "no" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def rec(i: int, tmp_sum: int, A_list: List[int], sum_list: List[bool]):
    if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

    rec(i + 1, tmp_sum + A_list[i], A_list, sum_list)
    rec(i + 1, tmp_sum, A_list, sum_list) def rec(i: int, tmp_sum: int, A_list: List[int], sum_list: List[bool]):
    if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

    rec(i + 1, tmp_sum + A_list[i], A_list, sum_list)
    rec(i + 1, tmp_sum, A_list, sum_list) rec def main():
    n = int(input())
    A_list = list(map(int, input().split()))
    q = int(input())
    m_list = list(map(int, input().split()))

    sum_list = [False for _ in range(2001)]

    rec(0, 0, A_list, sum_list)

    for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no") def main():
    n = int(input())
    A_list = list(map(int, input().split()))
    q = int(input())
    m_list = list(map(int, input().split()))

    sum_list = [False for _ in range(2001)]

    rec(0, 0, A_list, sum_list)

    for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no") main
from typing import List


def rec(i: int, tmp_sum: int, A_list: List[int], sum_list: List[bool]):
    if tmp_sum > 2000:
        return
    elif i == len(A_list):
        sum_list[tmp_sum] = True
        return

    rec(i + 1, tmp_sum + A_list[i], A_list, sum_list)
    rec(i + 1, tmp_sum, A_list, sum_list)


def main():
    n = int(input())
    A_list = list(map(int, input().split()))
    q = int(input())
    m_list = list(map(int, input().split()))

    sum_list = [False for _ in range(2001)]

    rec(0, 0, A_list, sum_list)

    for m in m_list:
        if sum_list[m]:
            print("yes")
        else:
            print("no")


if __name__ == "__main__":
    main()

