from math import log, pow

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

coins = [0]*31

for coin in a:
    coins[int(log(coin, 2))] += 1

for i in xrange(q):
    ans = 0
    j = int(raw_input())
    for k in range(30, 0, -1):
        if coins[k] > 0:
            pow_two_k = pow(2, k)
            coins_taken = min(int(j / pow_two_k), coins[k])
            ans += coins_taken
            j -= coins_taken * pow_two_k
            if j == 0:
                break
    
    if j > 0:
        print '-1'
    else:
        print ans

