from sys import stdin, stdout

n, q = [int(x) for x in stdin.readline().split()]
a = [int(x) for x in stdin.readline().split()]

coins = [0]*31

for coin in a:
    coins[coin.bit_length()-1] += 1

for i in xrange(q):
    ans = 0
    j = int(stdin.readline())
    for k in range(30, -1, -1):
        if coins[k] > 0:
            coins_taken = min(j >> k, coins[k])
            ans += coins_taken
            j -= coins_taken * (1 << k)
            if j == 0:
                break
    
    if j > 0:
        stdout.write('-1\n')
    else:
        stdout.write(str(ans) + '\n')