#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ++cnt[x];
  }
  while (q--) {
    int x;
    cin >> x;
    int ans = 0;
    for (int i = 30; i >= 0 && x > 0; --i) {
      int val = 1 << i;
      int need = min(x / val, cnt[val]);
      ans += need;
      x -= (need * val);
    }
    if (x != 0)
      cout << "-1 \n";
    else
      cout << ans << "\n";
  }
  return 0;
}
