N=int(input())
U=list(map(int,input().split()))
M=int(input())
T=list(map(int,input().split()))

#S = [[0 for j in range(3)] for i in range(2)]　2行3列の場合
dp = [[-1 for j in range(400001)] for i in range(N+1)]


def func(i,X,U,dp):
    if i==0:
        if X==0:
            return True
        else:
            return False
    if X<0:
        return False
    
    if dp[i][X] !=-1:
        return dp[i][X]
    
    
    if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
    if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
    dp[i][X]=0
    return dp[i][X]

for i in range(M):
    if func(N,T[i],U,dp)==True:
        print("yes")
    else:
        print("no") N=int(input()) N int(input()) int input() input U=list(map(int,input().split())) U list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split M=int(input()) M int(input()) int input() input T=list(map(int,input().split())) T list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split [-1 for j in range(400001)] for i in range(N+1) for i in range(N+1) i range(N+1) range N+1 N 1 for i in range(N+1) [-1 for j in range(400001)] dp = [[-1 for j in range(400001)] for i in range(N+1)] dp [[-1 for j in range(400001)] for i in range(N+1)] def func(i,X,U,dp):
    if i==0:
        if X==0:
            return True
        else:
            return False
    if X<0:
        return False
    
    if dp[i][X] !=-1:
        return dp[i][X]
    
    
    if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
    if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
    dp[i][X]=0
    return dp[i][X] func if i==0:
        if X==0:
            return True
        else:
            return False
     i==0 i 0 if X==0:
            return True
        else:
            return False
     X==0 X 0 return True True return False False if X<0:
        return False
    
     X<0 X 0 return False False if dp[i][X] !=-1:
        return dp[i][X]
    
    
     dp[i][X] !=-1 dp[i][X] [i] dp i X -1 return dp[i][X] dp[i][X] [i] dp i X if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
     func(i-1,X,U,dp) func i-1 i 1 X U dp dp[i][X]=1 dp[i][X] [i] dp i X 1 return dp[i][X] dp[i][X] [i] dp i X if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
     func(i-1,X-U[i-1],U,dp) func i-1 i 1 X-U[i-1] X U[i-1] U i-1 i 1 U dp dp[i][X]=1 dp[i][X] [i] dp i X 1 return dp[i][X] dp[i][X] [i] dp i X dp[i][X]=0 dp[i][X] [i] dp i X 0 return dp[i][X] dp[i][X] [i] dp i X i i X X U U dp dp for i in range(M):
    if func(N,T[i],U,dp)==True:
        print("yes")
    else:
        print("no") i range(M) range M if func(N,T[i],U,dp)==True:
        print("yes")
    else:
        print("no") func(N,T[i],U,dp)==True func(N,T[i],U,dp) func N T[i] T i U dp True print("yes") print "yes" print("no") print "no" U=list(map(int,input().split())) list(map(int,input().split())) U M=int(input()) int(input()) M N=int(input()) int(input()) N T=list(map(int,input().split())) list(map(int,input().split())) T dp = [[-1 for j in range(400001)] for i in range(N+1)] [[-1 for j in range(400001)] for i in range(N+1)] dp def func(i,X,U,dp):
    if i==0:
        if X==0:
            return True
        else:
            return False
    if X<0:
        return False
    
    if dp[i][X] !=-1:
        return dp[i][X]
    
    
    if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
    if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
    dp[i][X]=0
    return dp[i][X] def func(i,X,U,dp):
    if i==0:
        if X==0:
            return True
        else:
            return False
    if X<0:
        return False
    
    if dp[i][X] !=-1:
        return dp[i][X]
    
    
    if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
    if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
    dp[i][X]=0
    return dp[i][X] func
N=int(input())
U=list(map(int,input().split()))
M=int(input())
T=list(map(int,input().split()))

#S = [[0 for j in range(3)] for i in range(2)]　2行3列の場合
dp = [[-1 for j in range(400001)] for i in range(N+1)]


def func(i,X,U,dp):
    if i==0:
        if X==0:
            return True
        else:
            return False
    if X<0:
        return False
    
    if dp[i][X] !=-1:
        return dp[i][X]
    
    
    if func(i-1,X,U,dp):
        dp[i][X]=1
        return dp[i][X]
    if (func(i-1,X-U[i-1],U,dp)):
        dp[i][X]=1
        return dp[i][X]
    
    dp[i][X]=0
    return dp[i][X]

for i in range(M):
    if func(N,T[i],U,dp)==True:
        print("yes")
    else:
        print("no")
