from math import log
n,q=map(int,input().split())
l=list(map(int,input().split()))
ans=[0]*33
for i in range(n):
    x=int(log(l[i],2))
    ans[x]+=1
for _ in range(q):
    y=int(input())
    out=0
    for i in range(30,-1 and y>0,-1):
        need=min(y>>i,ans[i])
        out+=need
        y=y-(1<<i)*need
    if (y > 0):
        out = -1
    print(out)
 