a = []
d = {}

def decode():
    global a

    n = int(input())
    a = [int(x) for x in input().split()]

    q = int(input())
    ms = [int(x) for x in input().split()]

    return n, a, q, ms


def solve(i, m):
    global a, d

    if (i, m) in d:
        return d[(i, m)]

    if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False


if __name__ == '__main__':

    n, a, q, ms = decode()
    for m in ms:
        if solve(0, m):
            print("yes")
        else:
            print("no")
 a = [] a [] d = {} d {} def decode():
    global a

    n = int(input())
    a = [int(x) for x in input().split()]

    q = int(input())
    ms = [int(x) for x in input().split()]

    return n, a, q, ms decode global a n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a = [int(x) for x in input().split()] a [int(x) for x in input().split()] q = int(input()) q int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x ms = [int(x) for x in input().split()] ms [int(x) for x in input().split()] return n, a, q, ms return n, a, q, ms n a q ms def solve(i, m):
    global a, d

    if (i, m) in d:
        return d[(i, m)]

    if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False solve global a, d if (i, m) in d:
        return d[(i, m)]

     (i, m) in d (i, m) i m d return d[(i, m)] d[(i, m)] d (i, m) i m if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False a[i] == m a[i] a i m d[(i, m)] = True d[(i, m)] d (i, m) i m True return True True if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False i < len(a) - 1 i len(a) - 1 len(a) len a 1 if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

         solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])) solve(i+1, m) solve i+1 i 1 m m - a[i] > 0 and solve(i+1, m-a[i]) m - a[i] > 0 m - a[i] m a[i] a i 0 solve(i+1, m-a[i]) solve i+1 i 1 m-a[i] m a[i] a i d[(i, m)] = True d[(i, m)] d (i, m) i m True return True True d[(i, m)] = False d[(i, m)] d (i, m) i m False return False False d[(i, m)] = False d[(i, m)] d (i, m) i m False return False False i i m m if __name__ == '__main__':

    n, a, q, ms = decode()
    for m in ms:
        if solve(0, m):
            print("yes")
        else:
            print("no") __name__ == '__main__' __name__ '__main__' n, a, q, ms = decode() n decode() decode a q ms for m in ms:
        if solve(0, m):
            print("yes")
        else:
            print("no") m ms if solve(0, m):
            print("yes")
        else:
            print("no") solve(0, m) solve 0 m print("yes") print "yes" print("no") print "no" def decode():
    global a

    n = int(input())
    a = [int(x) for x in input().split()]

    q = int(input())
    ms = [int(x) for x in input().split()]

    return n, a, q, ms def decode():
    global a

    n = int(input())
    a = [int(x) for x in input().split()]

    q = int(input())
    ms = [int(x) for x in input().split()]

    return n, a, q, ms decode a, q, ms = decode() decode() a ms = decode() decode() ms a = [] [] a def solve(i, m):
    global a, d

    if (i, m) in d:
        return d[(i, m)]

    if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False def solve(i, m):
    global a, d

    if (i, m) in d:
        return d[(i, m)]

    if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False solve n, a, q, ms = decode() decode() n q, ms = decode() decode() q d = {} {} d
a = []
d = {}

def decode():
    global a

    n = int(input())
    a = [int(x) for x in input().split()]

    q = int(input())
    ms = [int(x) for x in input().split()]

    return n, a, q, ms


def solve(i, m):
    global a, d

    if (i, m) in d:
        return d[(i, m)]

    if a[i] == m:
        d[(i, m)] = True
        return True
    else:
        if i < len(a) - 1:

            if solve(i+1, m) or (m - a[i] > 0 and solve(i+1, m-a[i])):
                d[(i, m)] = True
                return True
            else:
                d[(i, m)] = False
                return False

        else:
            d[(i, m)] = False
            return False


if __name__ == '__main__':

    n, a, q, ms = decode()
    for m in ms:
        if solve(0, m):
            print("yes")
        else:
            print("no")

