n, q = map(int, input().split())
ar = list(map(int, input().split()))
mArr = {}
for i in ar:
    if i in mArr:
        mArr[i] += 1
    else:
        mArr[i] = 1
        
ans = []
for _ in range(q):
    q = int(input().strip())
    s = 0
    i = 1<<30
    while i>0:
        if i in mArr:
            n = q//i
        else:
            n = 0
        s += n
        q -= n*i
        i//=2
    ans.append( "-1" if q>0 else str(s) )
print(" ".join(ans))