from math import log2
n, q = [int(x) for x in input().split()]
coin = [int(x) for x in input().split()]

cnt = [0 for x in range(max(coin) + 1)]
for i in range(n):
    cnt[coin[i]] += 1

for _ in range(q):
    a = int(input())
    ans = 0
    i = 1
    while i <= a:
        i <<= 1
    i = i >> 1
    while i > 0:
        need = min(cnt[i], a//i)
        ans += need
        a -= need * i
        i >>= 1
        print(i, a, need, ans)
    print(-1 if a else ans)

