import random, math, sys
from copy import deepcopy as dc
from bisect import bisect_left, bisect_right
from collections import Counter

input = sys.stdin.readline

def power(x, y): 
  
    if (y == 0): return 1
    elif (int(y % 2) == 0): 
        return (power(x, int(y / 2)) *
               power(x, int(y / 2))) 
    else: 
        return (x * power(x, int(y / 2)) *
                   power(x, int(y / 2))) 

# Function to call the actual solution
def solution(li, q):
	ma = Counter(li)
	pot = []
	for i in range(34):
		pot.append(1<<i)
	for i in range(q):
		num = int(input())
		if num % 2 != 0:
			print(-1)
		else:
			p = int(math.log2(num)) + 1
			s = 0
			ma1 = ma
			inc = {}
			while num > 0 and p:
				po = pot[p]
				if po <= num and po in ma1 and ma1[po]:
					num -= po
					ma1[po] -= 1
					s += 1
					inc[po] = inc.get(po, 0) + 1
				else:
					p -= 1
			for i in inc:
				ma[i] += inc[i]
			print(s)


# Function to take input
def input_test():
	# for _ in range(int(input())):
		# n = int(input())
		n, q = map(int, input().strip().split(" "))
		# a, b, c = map(int, input().strip().split(" "))
		li = list(map(int, input().strip().split(" ")))
		out = solution(li, q)
		# print(out)

# Function to test my code
def test():
	pass


input_test()
# test()