Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

def solve(i,left):
    if left == 0:
        return True
    elif i >= n:
        return False
    return solve(i+1, left) or solve(i+1, left - data[i])

for j in range(m):
    if solve(0, test[j]):
        print 'yes'
    else:
        print 'no'

    

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'

Buggy python submission (verdict: Runtime Error):
wimport numpy as np

n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'
        

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'

Buggy python submission (verdict: Runtime Error):
wimport numpy as np

n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'
        

Fixed submission:
n = int(raw_input())
data = map(int, raw_input().split())
m = int(raw_input())
test = map(int, raw_input().split())

# def solve(i,left):
#     if left == 0:
#         return True
#     elif i >= n:
#         return False
#     return solve(i+1, left) or solve(i+1, left - data[i])

# for j in range(m):
#     if solve(0, test[j]):
#         print 'yes'
#     else:
#         print 'no'

a = [0]
for i in range(n):
    a = a + [a[j] + data[i] for j in range(len(a))]

for i in range(m):
    if test[i] in a:
        print 'yes'
    else:
        print 'no'