import sys
input = sys.stdin.readline
out = sys.stdout
n, q = map(int,input().split())
d = {}
for i in input().split():
    t = d.get(int(i), 0) + 1
    d[int(i)] = t
l = sorted(d.keys(), reverse = True)
for _ in range(q):
    b = int(input())
    s = 0
    for k in l:
        cur = min(int(b/k), d[k])
        s += cur
        b -= k*cur
    if b != 0:
        out.write('-1' + '\n')
    else:
        out.write(str(s) + '\n')