# -*- coding:utf-8 -*-
import sys


def exhaustive(lst, size):
    result = []
    for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
    return result


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n, data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst]
    result = exhaustive(data, int(n[0]))
    print("\n".join(["yes" if x in result else "no" for x in targets])) import sys sys def exhaustive(lst, size):
    result = []
    for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
    return result exhaustive result = [] result [] for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
     i range(0, 1 << size) range 0 1 << size 1 size total = 0 total 0 for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
         j range(0, size) range 0 size if (i & 0x01) == 1:
                total += lst[j]
             (i & 0x01) == 1 i & 0x01 i 0x01 1 total += lst[j] total lst[j] lst j i = i >> 1 i i >> 1 i 1 result.append(total) result.append result append total return result result lst lst size size if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n, data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst]
    result = exhaustive(data, int(n[0]))
    print("\n".join(["yes" if x in result else "no" for x in targets])) __name__ == "__main__" __name__ "__main__" val.split() for val in sys.stdin.read().splitlines() for val in sys.stdin.read().splitlines() val sys.stdin.read().splitlines() sys.stdin.read().splitlines sys.stdin.read() sys.stdin.read sys.stdin sys stdin read splitlines for val in sys.stdin.read().splitlines() val.split() val.split val split lst = [val.split() for val in sys.stdin.read().splitlines()] lst [val.split() for val in sys.stdin.read().splitlines()] [int(n) for n in inner_lst] for inner_lst in lst for inner_lst in lst inner_lst lst for inner_lst in lst [int(n) for n in inner_lst] n, data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst] n [[int(n) for n in inner_lst] for inner_lst in lst] data m targets result = exhaustive(data, int(n[0])) result exhaustive(data, int(n[0])) exhaustive data int(n[0]) int n[0] n 0 "yes" if x in result else "no" for x in targets for x in targets x targets for x in targets "yes" if x in result else "no" x in result x result "yes" "no" print("\n".join(["yes" if x in result else "no" for x in targets])) print "\n".join(["yes" if x in result else "no" for x in targets]) "\n".join "\n" join ["yes" if x in result else "no" for x in targets] data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst] [[int(n) for n in inner_lst] for inner_lst in lst] data lst = [val.split() for val in sys.stdin.read().splitlines()] [val.split() for val in sys.stdin.read().splitlines()] lst targets = [[int(n) for n in inner_lst] for inner_lst in lst] [[int(n) for n in inner_lst] for inner_lst in lst] targets n, data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst] [[int(n) for n in inner_lst] for inner_lst in lst] n def exhaustive(lst, size):
    result = []
    for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
    return result def exhaustive(lst, size):
    result = []
    for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
    return result exhaustive m, targets = [[int(n) for n in inner_lst] for inner_lst in lst] [[int(n) for n in inner_lst] for inner_lst in lst] m result = exhaustive(data, int(n[0])) exhaustive(data, int(n[0])) result
# -*- coding:utf-8 -*-
import sys


def exhaustive(lst, size):
    result = []
    for i in range(0, 1 << size):
        total = 0
        for j in range(0, size):
            if (i & 0x01) == 1:
                total += lst[j]
            i = i >> 1
        result.append(total)
    return result


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n, data, m, targets = [[int(n) for n in inner_lst] for inner_lst in lst]
    result = exhaustive(data, int(n[0]))
    print("\n".join(["yes" if x in result else "no" for x in targets]))