#include <bits/stdc++.h>
using namespace std;
int n, q, b, i, x, r, h[30];
int main() {
  for (cin >> n >> q; i < n; i++) cin >> x, h[int(log2(x))]++;
  for (; q--;) {
    cin >> b;
    for (r = 0, i = 29; i >= 0; i--) {
      x = min(h[i], b / (1 << i));
      b -= x * (1 << i);
      r += x;
    }
    cout << (b ? -1 : r) << endl;
  }
}
