import collections
n,q=map(int,input().split())
a=list(map(int,input().split()))
li=[0]*32
for key,val in collections.Counter(a).items():
    li[key.bit_length()-1]=val
#print(li)
for _ in range(q):
    ans=0
    k=int(input())
    for i in range(31,-1,-1):
        mini=min(k>>i,li[i])
        ans+=mini
        k-=mini<<i
        if k==0:
            break
    ans=ans if k==0 else -1