from sys import stdin
n,q = map(int,stdin.readline().split())
a = map(int,stdin.readline().split())
di = {}
for i in a:
    di[i] = di.get(i,0) + 1
b = list(set(a))
b.sort()
b.reverse()
for i in xrange(q):
    x = int(stdin.readline())
    ans = 0
    for j in b:
        m = x/j
        n = di.get(j,0)
        m = min(m,n)
        ans += m
        x -= j*m
    if x:
        print -1
    else:
        print ans
print ans