from collections import Counter
rd = lambda: map(int, input().split(' '))
n, q = rd()
a = sorted(Counter(rd()).items(), reverse=True)
aa = []
for _ in range(q):
    b = int(input())
    ans = 0
    for x, cnt in a:
        to_del = cnt if x * cnt <= b else b // x
        ans += to_del
        b -= to_del * x
    aa.append(ans if b == 0 else -1)
print(' '.join(map(str, aa)))
