#include <bits/stdc++.h>
using namespace std;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1e9, 1e9);
int p[60];
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, x, q;
  cin >> n >> q;
  while (n--) {
    cin >> x;
    int y = 0;
    while (!(x & 1)) ++y, x >>= 1;
    ++p[y];
  }
  while (q--) {
    cin >> x;
    int res = 0;
    for (int i = 31; i >= 0 && x > 0; --i)
      res += min((x & (1 << i)) ? 1 : 0, p[i]),
          x -= (1 << i) * min((x & (1 << i)) ? 1 : 0, p[i]);
    cout << (x > 0 ? -1 : res) << '\n';
  }
}
