import sys
input = lambda: sys.stdin.readline().rstrip()
n, q = map(int, input().split())
l = (2*10**9).bit_length() + 2
a = [0]*l
for i in map(int, input().split()):
    cnt = 0
    while i>1:
        i //= 2
        cnt += 1
    a[cnt] += 1

for _ in range(q):
    b = int(input())
    cnt = 0
    for i in range(l-1, -1, -1):
        tmp = min(b//2**i, a[i])
        cnt += tmp
        b -= 2**i*tmp
    if b>0:
        print(-1)
    else:
        print(cnt)