import sys
from collections import Counter
n,k=map(int,raw_input().split())
l=map(int,raw_input().split())
l=sorted(Counter(l).most_common(n),reverse=True)
for i in range(k):
	a=int(sys.stdin.readline())
	count=0
	for j in range(len(l)):
		b=a/l[j][0]
		c=min(l[j][1],b)
		count+=c
		a=a-c*l[j][0]	
		if a==0:
			sys.stdout.write(str(count))
			sys.stdout.write('\n')
			break
	if a!=0:
		sys.stdout.write('-1')
		sys.stdout.write('\n')
			