n, q = map(int, raw_input().split(' '))

a = map(int, raw_input().split(' '))

cnt = [0] * 31

for i in range(0, n):
    x = 1
    for d in range(0, 31):
        if x == a[i]:
            cnt[d] += 1
        x *= 2

rev = reversed(range(0, 31))

for i in range(0, q):
    ans = 0
    b = int(raw_input())
    for j in rev:
        r = min(cnt[j], b / (1 << j))
        ans += r
        b -= r * (1 << j)
    if (b > 0):
        ans = -1
    print ans





