import re
st1=input().split(" ")
n,q=[int(x) for x in st1][0],[int(x ) for x in st1][1]
st2=input().split(" ")
a=[int(x) for x in st2]
a.sort()
j=[]
kk=[]
for i in range(q):
    kk.append(int(input()))
b=[x for x in range(max(kk)+1)]
g=[]
for i in range(len(a)):
    c=[]
    for j in range(max(b)+1):
        c.append(0)
    g.append(c)
for i in range(len(a)):
    g[i][0]=1
g[0][a[0]]=1
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]>b[j]:
            g[i][j]=0
        elif a[i]==b[j]:
            g[i][j]=1
        elif a[i]<b[j]:
            if g[i-1][b[j]-a[i]]==0:
                g[i][j]=0
            else:
                g[i][j]=g[i-1][b[j]-a[i]]+1

for i in kk:
    cont=[]
    for k in range(len(a)):
        if g[k][i]!=0:
            cont.append(g[k][i])
    if (len(cont)==0):
        print(-1)
    else:
        print(min(cont))