n,q = map(int,raw_input().split())
nums = list(map(int,raw_input().split()))
arr = [0 for x in range(35)]
vals = [pow(2,x) for x in range(35)]
for i in nums:
  cnt = 0
  while i:
    i/=2
    cnt += 1
  arr[cnt-1] += 1
for i in range(q):
  a = int(raw_input())
  need = [0 for x in range(35)]
  took = [0 for x in range(35)]
  cnt = 0
  while a:
    need[cnt] = a%2
    a /= 2
    cnt += 1
  ans = 0
  found = 1
  for j in range(34,-1,-1):
    if need[j]:
      if arr[j]-took[j]:
        took[j] += 1
        ans += 1
      else:
        tar = vals[j]
        for k in range(j-1,-1,-1):
          if ((arr[k]-took[k])*vals[k])>=tar:
            took[k] += tar/vals[k]
            ans += tar/vals[k]
          else:
            tar -= (arr[k]-took[k])*vals[k]
            ans += arr[k]-took[k]
            took[k] = arr[k]
        if tar:
          found = 0
          break
  if found:
    print ans
  else:
    print -1