Buggy python submission (verdict: Runtime Error):
n = input()
A = []
for i in range(n):
   A.append(int(raw_input()))

q = input()
M = []
for i in range(n):
   M.append(int(raw_input()))

def solve(i, m)
   if m == 0
     return true
   if i >= n
     return false
   res = solve(i + 1, m) || solve(i + 1, m - A[i])
   return res

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

 

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = []
for i in range(n):
   A.append(int(raw_input()))

q = input()
M = []
for i in range(n):
   M.append(int(raw_input()))

def solve(i, m)
   if m == 0
     return true
   if i >= n
     return false
   res = solve(i + 1, m) || solve(i + 1, m - A[i])
   return res
for i in M:
   if solve(0,m):
      print "yes"
   else:
      print "no"

 

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = []
for i in range(n):
   A.append(int(raw_input()))

q = input()
M = []
for i in range(n):
   M.append(int(raw_input()))

def solve(i, m)
   if m == 0
     return true
   if i >= n
     return false
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res
for i in M:
   if solve(0,m):
      print "yes"
   else:
      print "no"

 

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
return true
if i >= n and m > sum(A)
return false
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M
   if res = solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
return True
if i >= n and m > sum(A)
return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M
   if res = solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n and m > sum(A)
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M
   if res = solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n and m > sum(A)
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M
   if solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n and m > sum(A):
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M
   if solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n or m > sum(A):
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

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

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n or m > sum(A):
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

for m in M:
   if solve(0,m):
      print 'yes'
   else:
      print 'no'

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
   return True
if i >= n or m > sum(A):
   return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

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

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
  return True
if i >= n or m > sum(A):
  return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

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

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
  return True
if i >= n or m > sum(A):
  return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

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

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
if m == 0:
  return True
if i >= n or m > sum(A):
  return False
res = solve(i + 1, m) or solve(i + 1, m - A[i])
return res

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

Fixed submission:
n = input()
A = map(int, raw_input().split())
q = input()
M = map(int, raw_input().split())

def solve(i, m):
   if m == 0:
     return True
   if i >= n or m > sum(A):
     return False
   res = solve(i + 1, m) or solve(i + 1, m - A[i])
   return res

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