from sys import stdin
input=stdin.readline
n,q=map(int,input().split())
a=list(map(int,input().split()))
cnt=[0]*31
for i in range(n):
  x=a[i]
  c=0
  while x%2==0:
    x//=2
    c+=1
  cnt[c]+=1
f=[0]*31
f[0]=1
for i in range(1,31):
  f[i]=f[i-1]*2
for _ in range(q):
  b=int(input())
  ans=0
  for j in range(31)[::-1]:
    cur=min(b//f[j],cnt[j])
    b-=cur*f[j]
    ans+=cur
  if b>0:
    print(-1)
  else:
    print(ans)