#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  vector<long long> c(n, 0);
  map<long long, int> cnum;
  for (int i = 0; i < n; ++i) {
    cin >> c[i];
    cnum[c[i]]++;
  }
  for (int i = 0; i < q; ++i) {
    long long num;
    cin >> num;
    long long ret = 0;
    long long rem = num;
    for (long long j = 0; j < 33ll; ++j) {
      long long count = rem / (1ll << (33ll - j));
      if (count < cnum[1ll << (33ll - j)]) {
        rem -= count * (1ll << (33ll - j));
        ret += count;
      } else {
        rem -= cnum[1ll << (33ll - j)] * (1ll << (33ll - j));
        ret += cnum[1ll << (33ll - j)];
      }
    }
    if (rem == 0) {
      cout << ret << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
