# import os, sys, atexit
#
# range = xrange
# from cStringIO import StringIO as BytesIO
#
# sys.stdout = BytesIO()
# atexit.register(lambda: os.write(1, sys.stdout.getvalue()))
# input = BytesIO(os.read(0, os.fstat(0).st_size)).readline

from sys import stdin, stdout
from math import log

rints = lambda: [int(x) for x in stdin.readline().split()]
n, q = rints()
a, b = rints(), [int(stdin.readline()) for _ in range(q)]

mem, mem2, out = [0] * 32, [0] * 32, []
for i in a:
    mem[int(log(i, 2))] += 1

for i in b:
    ans, tem, num = 0, 1, 0

    for k, j in enumerate(bin(i)[2:][::-1]):
        mem2[k] = int(j)
        num = k

    while num >= 0:
        if mem[num] >= tem:
            ans += tem
            tem = 0
        else:
            ans += mem[num]
            tem = (tem - mem[num]) * 2

        num -= 1
        tem += mem2[num]

    if tem:
        ans = -1

    out.append(str(ans))
stdout.write('\n'.join(out))
