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