#include <bits/stdc++.h>
using namespace std;
int n, q;
int cnt[30 + 5];
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    for (int j = 0;; j++) {
      if ((1LL << j) & a) {
        cnt[j]++;
        break;
      }
    }
  }
  while (q--) {
    long long b;
    cin >> b;
    bool f = true;
    int ans = 0;
    long long need = 0;
    for (int i = 34; i >= 0; i--) {
      if (((1LL) << i) & b) {
        need++;
      }
      ans += min(cnt[i], (int)need);
      need = max(0LL, need - cnt[i]);
      need *= 2;
    }
    if (need != 0) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
  }
  return 0;
}
