#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long i, j, k, m, n, q, r, c, x;
  cin >> n >> q;
  vector<long long> v(32, 0);
  for (long long(i) = (0); (i) < (n); ++(i)) {
    cin >> k;
    k = k >> 1;
    r = 0;
    while (k != 0) {
      r++;
      k = k >> 1;
    }
    v[r]++;
  }
  long long ans;
  while (q--) {
    cin >> n;
    ans = 0;
    for (i = 31; i >= 0 && n; i--) {
      x = 1 << i;
      if (v[i] * x <= n) {
        ans += v[i];
        n -= v[i] * x;
      } else {
        r = n / x;
        ans += r;
        n -= r * x;
      }
    }
    if (n) {
      cout << "-1\n";
    } else {
      cout << ans << "\n";
    }
  }
}
