Buggy python submission (verdict: Runtime Error):
num_n = raw_input()
ele_n = raw_input()
num_m = raw_input()
ele_m = raw_input()

n = ele_n.split()
m = ele_m.split()

for i in range(int(num_n) - 1):
    for j in range(2 ** (int(num_m) - 1)):
        sum[j] = 0
        sum[j] += m[j]
        sum += m[j]
        if n[i] == sum:
            print "yes"
            break
    print "no" 

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = raw_input()
ele_n = raw_input()
num_m = raw_input()
ele_m = raw_input()
 
n = ele_n.split()
m = ele_m.split()

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

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

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = raw_input()
ele_n = raw_input()
num_m = raw_input()
ele_m = raw_input()
  
n = int(ele_n.split())
m = int(ele_m.split())
 
def solve(i, t):
   if t == 0:
      return True
   if i >= num_n:
      return False
   res = solve(i + 1, t) or solve(i + 1,t - n[i])
   return res
 
for t in m:
   if solve(0, t):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = input()
N = map(int, raw_input())
num_m = input()
M = map(int, raw_input())

def solve(i, m):
   if m == 0:
      return True
   if i >= num_n:
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
 
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = raw_input()
ele_n = raw_input()
num_m = raw_input()
ele_m = raw_input()
   
n = int(ele_n.split())
m = int(ele_m.split())
  
def solve(i, t):
   if t == 0:
      return True
   if i >= num_n or t > sum(n):
      return False
   res = solve(i + 1, t) or solve(i + 1,t - n[i])
   return res
  
for t in m:
   if solve(0, t):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = input()
N = map(int, raw_input())
num_m = input()
M = map(int, raw_input())

def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
 
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = input()
N = map(int, raw_input().split)
num_m = input()
M = map(int, raw_input().split)
 
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
  
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Time Limit Exceeded):
num_n = input()
N = map(int, raw_input().split())
num_m = input()
M = map(int, raw_input().split())
  
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
   
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Time Limit Exceeded):
num_n = input()
N = map(int, raw_input().split())
num_m = input()
M = map(int, raw_input().split())
   
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(M):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - N[i])
   return res
    
for m in M:
   if solve(0, m):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = input()
n = map(int, raw_input().split())
num_m = input()
m = map(int, raw_input().split())
    
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
     
for k in m:
   if solve(0, m[k]):
      print "yes"
   else:
      print "no"

Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

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

_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

for val in (int(x) for x in input().split()):
    if exSearch(0, val, hoge):
        print ('yes')
    else:
        print ('no')


Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

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

_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

for val in (int(x) for x in input().split()):
    if exSearch(0, val, hoge):
        print ('yes')
    else:
        print ('no')


Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

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

if __name__ == '__main__':
    _ = int(input())
    hoge = [int(x) for x in input().split()]
    _ = int(input())

    for val in (int(x) for x in input().split()):
        if exSearch(0, val, hoge):
            print ('yes')
        else:
            print ('no')


Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')


Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')

Buggy python submission (verdict: Runtime Error):
num_n = int(input())
n = map(int, input().split())
num_m = int(input())
m = map(int, input().split())
     
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
      
for k in range(num_m):
   if solve(0, m[k]):
      print ("yes")
   else:
      print ("no")


Fixed submission:
_ = int(input())
hoge = [int(x) for x in input().split()]
_ = int(input())

def exSearch(i, m):
    if m == 0:
        return True
    if i >= len(hoge) or m > sum(hoge):
        return False
    res = exSearch(i+1, m) or exSearch(i+1, m-hoge[i])
    return res

if __name__ == '__main__':
    
    for val in (int(x) for x in input().split()):
        if exSearch(0, val):
            print ('yes')
        else:
            print ('no')