n,Q = map(int, input().split())
A = list(map(int, input().split()))
from collections import Counter
C = Counter(A)
C = list(C.items())
C.sort(reverse=True)
#print(C)

ANS = []
for i in range(Q):
    b = int(input())
    ans = 0
    for k, v in C:
        q, r = divmod(b, k)
        if q <= v:
            b = r
            ans += q
        else:
            b -= k*v
            ans += v
    if b == 0:
        ANS.append(ans)
    else:
        ANS.append(-1)
print(*ANS, sep='\n')
