#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long t, n, q, ans, u;
  long long x = 1;
  long long a[30];
  memset(a, 0, sizeof a);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> t;
    u = log(t) / log(2);
    a[u]++;
  }
  for (int i = 0; i < q; i++) {
    cin >> t;
    ans = 0;
    for (int j = 30; j >= 0; j--) {
      if ((1ll << j) <= t) {
        ans += min(a[j], t / (1ll << j));
        t -= (1ll << j) * min(a[j], t / (1ll << j));
      }
    }
    if (t == 0)
      cout << ans - 1 << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
