#include <bits/stdc++.h>
int n, m, i, j, t, ans, f[65];
long long b[65], k;
long double tt, a[200005];
int main() {
  memset(f, 0, sizeof(f));
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%llf", &a[i]);
    tt = (long double)(log(a[i]) / log(2.0)) + 0.4;
    t = (int)tt;
    f[t]++;
  }
  for (i = 1, b[0] = 1; i <= 32; i++) b[i] = (long long)b[i - 1] * 2;
  while (m--) {
    scanf("%lld", &k);
    for (i = 32, ans = 0; i >= 0; i--) {
      t = k / b[i];
      if (t <= f[i]) {
        ans += t;
        k -= b[i] * t;
      } else {
        ans += f[i];
        k -= f[i] * t;
      }
    }
    if (k)
      puts("-1");
    else
      printf("%d\n", ans);
  }
  return 0;
}
