#include <bits/stdc++.h>
using namespace std;
const int lim = 35;
int sum, n, q, x, nr, cnt;
int v[lim], r[lim];
int exp(int a) {
  int cnt = 0;
  while (a > 1) a /= 2, ++cnt;
  return cnt;
}
void frzero() {
  for (int i = 0; i <= lim; ++i) r[i] = 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) cin >> x, ++v[exp(x)];
  for (int e = 0; e < q; ++e) {
    cin >> sum;
    frzero();
    nr = 0;
    cnt = 0;
    while (sum) cnt += sum % 2, r[++nr] = sum % 2, sum /= 2;
    for (int k = nr; k >= 1; --k)
      if (v[k - 1] < r[k]) {
        r[k - 1] += 2 * (r[k] - v[k - 1]);
        cnt += r[k] - v[k - 1];
        r[k] = v[k - 1];
      }
    if (r[0] > 0)
      cout << -1 << endl;
    else
      cout << cnt << endl;
  }
  return 0;
}
