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
from collections import *
from copy import deepcopy

rints = lambda: [int(x) for x in input().split()]
n, q = rints()
a, b = rints(), [int(input()) for _ in range(q)]
mem, out = Counter(a), []

for i in b:
    mem2, ans, tem = deepcopy(mem), 0, [1, 0]

    for k, j in enumerate(bin(i)[2:][::-1]):
        if int(j):
            num = pow(2, k)
            while num:
                if mem2[num] >= tem[0]:
                    mem2[num] -= tem[0]
                    break

                tem = [(tem[0] - mem2[num]) * 2, mem2[num]]
                mem2[num] = 0
                num >>= 1

            if not num:
                ans = -1
                break

            ans += tem[0]
            tem = [1, 0]

    out.append(ans)
print('\n'.join(map(str, out)))
