import sys
from itertools import product


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))
    ans = [False] * q
    for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
    for a in ans:
        print("yes" if a else "no")


if __name__ == "__main__":
    main()
 import sys sys from itertools import product def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))
    ans = [False] * q
    for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
    for a in ans:
        print("yes" if a else "no") main input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline 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 ans = [False] * q ans [False] * q [False] False q for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
     e product((0, 1), repeat=n) product (0, 1) 0 1 repeat=n repeat n s = 0 s 0 for i in range(n):
            s += e[i] * a[i]
         i range(n) range n s += e[i] * a[i] s e[i] * a[i] e[i] e i a[i] a i for i in range(q):
            if m[i] == s:
                ans[i] = True
     i range(q) range q if m[i] == s:
                ans[i] = True
     m[i] == s m[i] m i s ans[i] = True ans[i] ans i True for a in ans:
        print("yes" if a else "no") a ans print("yes" if a else "no") print "yes" if a else "no" a "yes" "no" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))
    ans = [False] * q
    for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
    for a in ans:
        print("yes" if a else "no") def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))
    ans = [False] * q
    for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
    for a in ans:
        print("yes" if a else "no") main
import sys
from itertools import product


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))
    ans = [False] * q
    for e in product((0, 1), repeat=n):
        s = 0
        for i in range(n):
            s += e[i] * a[i]
        for i in range(q):
            if m[i] == s:
                ans[i] = True
    for a in ans:
        print("yes" if a else "no")


if __name__ == "__main__":
    main()

