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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A[i])
  return res
 
 for j in range(0, q-1):
  if m == solve(i + 1, m) || solve(i + 1, m - A[i]):
   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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A[i])
  return res
 
 for j in range(0, q-1):
  if m == solve(j, m(j)):
   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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A[i])
  return res
 
for j in range(0, q-1):
 if m == solve(j, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

 def solve(i, m):
  if i == m:
   return true
  if i > n:
   return false
  res = solve(i + 1, m) || solve(i + 1, m - A[i])
   return res
 
 for j in range(0, q-1):
  if m == solve(j, m(j)):
   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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

 def solve(i, m):
  if i == m:
   return true
  if i > n:
   return false
  res = solve(i + 1, m) || solve(i + 1, m - A(i))
   return res
 
 for j in range(0, q):
  if m == solve(j, m(j)):
   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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A(i))
  return res
 
for j in range(0, q-1):
 if m == solve(0, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) || solve(i + 1, m - A(i))
 return res
 
for j in range(0, q-1):
 if m == solve(j, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) or solve(i + 1, m - A(i))
 return res
 
for j in range(0, q):
 if m == solve(0, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

Buggy python submission (verdict: Runtime Error):
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
m = map(int, raw_input().split())
??
def solve(i, m):
??if m == 0:
????return true
??if i >= n and m > 0:
????return false
??res = solve(i + 1, m) or solve(i + 1, m - A(i))
??return res
????
for j in range(0, q):
??if m == solve(0, m(j)):
????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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

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

for j in range(0, q):
 if m == solve(0, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  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:
  return false
 res = solve(i + 1, m) or solve(i + 1, m - A(i))
 return res

for j in range(0, q):
 if solve(0, m(j)):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

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

for j in range(0, q):
 if m == solve(0, m[j]):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'

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

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

for j in range(0, q):
 if solve(0, m[j]):
  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 j in range(0, q):
 if solve(0, m[j]):
  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 j in range(0, q-1):
 if solve(0, m[j]):
  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 j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'