#include <bits/stdc++.h>
using namespace std;
const int e = 4e5 + 69;
long long cnt[34];
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    cnt[__builtin_ctz(x)]++;
  }
  while (q--) {
    long long x;
    cin >> x;
    int ans = 0;
    for (int i = 30; i >= 0 && x > 0; i--) {
      int need = min(x >> i, cnt[i]);
      x -= (1 << i) * need;
      ans += need;
    }
    if (x != 0) {
      ans = -1;
    }
    cout << ans << "\n";
  }
}
