#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  vector<int> v(31, 0);
  while (n--) {
    int x;
    cin >> x;
    v[31 - __builtin_clz(x)]++;
  }
  while (q--) {
    int x;
    cin >> x;
    int ans = 0;
    int carry_over = 0;
    for (int i = 30; i >= 0; i--) {
      int current = ((x & (1 << i)) > 0) + carry_over;
      ans += min(current, v[i]);
      current -= min(current, v[i]);
      carry_over = 2 * current;
    }
    if (carry_over > 0) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
  }
  return 0;
}
