#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int a[N], n, x, Q;
int sol() {
  int cnt = 0;
  for (int i = 31; x && i >= 0; i--) {
    if (a[i]) {
      int r = x / (1 << i);
      r = min(r, a[i]);
      cnt += r;
      r *= (1 << i);
      x -= r;
    }
  }
  if (x) cnt = -1;
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> Q;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    x = log2(x);
    a[x]++;
  }
  while (Q--) {
    cin >> x;
    cout << sol() << "\n";
  }
}
