#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = (int)4e5 + 5;
int n, q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  vector<int> count(31);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    count[__builtin_ctz(x)]++;
  }
  while (q--) {
    int ans = 0;
    int cur;
    cin >> cur;
    for (int i = 30; i >= 0; i--) {
      int need = min(cur >> i, count[i]);
      ans += need;
      cur -= ((1 << i) * need);
    }
    if (cur > 0) ans = -1;
    cout << ans << endl;
  }
  return 0;
}
