import sys
input=lambda:sys.stdin.readline().rstrip()
n,q=map(int,input().split())
a=list(map(int,input().split()))
from collections import Counter
d=Counter(a)
sa=list(set(a))
sa.sort(reverse=1)
for _ in range(q):
  x=int(input())
  ans=0
  for i in sa:
    if x>=i:
      m=min(x//i,d[i])
      x-=m*i
      ans+=m
  if x:print(-1)
  else:print(ans)
  