#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n, q, x;
  cin >> n >> q;
  long long cnt[50] = {0};
  for (int i = 0; i < n; i++) {
    cin >> x;
    long long temp = log2(x);
    cnt[temp]++;
  }
  for (int i = 0; i < q; i++) {
    long long qe;
    cin >> qe;
    long long res = 0;
    for (int j = 49; j >= 0; j--) {
      long long cur = qe / (1 << j);
      res += min(cnt[j], cur);
      qe -= (min(cnt[j], cur) << j);
    }
    if (qe) res = -1;
    cout << res << "\n";
  }
  return 0;
}
