import math

n,q=map(int,input().split())
x=[0]*31
y=[0]*n
y=map(int,input().split())
for i in y:
    x[math.floor(math.log2(i))]+=1
print (x)
for i in range(q):
    b=int(input())
    ans=0
    for i in range(30,-1,-1):
        need=min(int(b/(1<<i)),x[i])
        b-=need*(1<<i)
        ans+=need
    if b>0:
        print(-1)
    else:
        print(ans)
