Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(len(A)):
        C = itl.combinations(A, i)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(len(A)):
        C = itl.combinations_with_replacemant(A, i)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(len(A)):
        C = itl.combinations(A, i)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(len(A)):
        C = itl.combinations(A, i)
        #print(C)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(n):
        C = itl.combinations(A, i+1)
        #print(C)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
    if flg: print("yes")
    else: print("no")



Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(n):
        C = itl.combinations(A, i+1)
        #print(C)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(n):
        C = itl.combinations(A, i+1)
        for j in C:
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")



Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

C = [False for i in range(q)]
for i in range(1, n+1):
    for j in itl.combinations(A, i):
        for mi in range(q):
            if sum(j) == M[mi]:
                C[mi] = True
                
for c in C:
    if c: print("yes")
    else: print("no")



Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(n):
        for j in itl.combinations(A, i+1):
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
def solve(A, n, i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    res = solve(A, n, i+1, m) or solve(A, n, i+1, m-A[i])
    return res

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

for m in M:
    if solve(A, len(A), 0, m):
        print("yes")
    else:
        print("no")


Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

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

for mi in M:
    flg = False
    for i in range(n):
        for j in list(itl.combinations(A, i+1)):
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")



Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

Buggy python submission (verdict: Runtime Error):
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

"""通る(ko)
for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")

"""

for mi in M:
    flg = False
    for i in range(n):
        for j in list(itl.combinations(A, i+1)):
            if sum(j) == mi:
                flg = True
                break
        if flg: break
    if flg: print("yes")
    else: print("no")



Fixed submission:
import itertools as itl

n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
S = []

for i in range(n):
    cmb = list(itl.combinations(A, i+1))
    for j in cmb:
        S.append(sum(j))

for m in M:
    flg = False
    for s in S:
        if s == m:
            flg = True
            break
    if flg:
        print("yes")
    else:
        print("no")