from collections import Counter
rd = lambda: map(int, raw_input().split(' '))
n, q = rd()
a = sorted(Counter(rd()).items(), reverse=True)
if n > 1000:
    print a
for _ in xrange(q):
    b = rd()[0]
    ans = 0
    for x, cnt in a:
        if x * cnt > b:
            to_del = b / x
            ans += to_del
            b -= to_del * x
        else:
            ans += cnt
            b -= cnt * x
    print ans if b == 0 else -1