n,q=map(int,input().split())
arr=list(map(int,input().split()))
d={}
for i in arr:
	if i not in d:
		d[i]=1
	else:
		d[i]+=1
for i in range(q):
	x=int(input())
	y=1<<30
	ss=0
	while y>=1:
		loc=0
		if y not in d:
			loc=(x//y)
		else:
			loc=min(d[y],x//y)
		# print("loc",loc)
		ss+=loc
		x-=(loc*y)
		# print("loc y",loc*y)
		y=y>>1
	if x!=0:
		print(-1)
	else:
		print(ss)