params = input()

n, q = int(params.split(" ")[0]), int(params.split(" ")[1])

a = []

params = input()

for i in params.split(" "):
	a.append(int(i))
#a = sorted(a,reverse=True)

j =[]

for i in range(0,q):
	j.append(int(input()))

#print("")

def remove_values_from_list(the_list, val):
   return [value for value in the_list if value != val]

def coinCount(j,a,n):
	count= 0
	b = []
	b.extend(a)
	print(b,"\n")
	while len(b) > 0:
		#print(max(b),j)
		if not j-max(b) >= 0:
			b = remove_values_from_list(b,max(b))
		else:
			j = j-max(b)
			count += 1
			b.remove(max(b))
			if j == 0:
				return(count)
		#print(b,"\n")
	return("-1")

for i in range(0,q):
	if not j[i]%2 == 0:
		print("-1")
	else:
		print(coinCount(j[i],a,n))