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