#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
  long long n, q, m, a[200005], p[35], monete, i;
  for (int i = 0; i < 35; i++) p[i] = 0;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p[(long long)(round(log(a[i]) / log(2)))]++;
  }
  for (int j = 1; j <= q; j++) {
    cin >> m;
    monete = 0;
    i = 30;
    while ((i >= 0) && (m >= 0)) {
      if ((p[i] != 0) && ((long long)(pow(2, i) <= m))) {
        if (m >= (long long)(pow(2, i) * p[i])) {
          m -= (long long)(pow(2, i) * p[i]);
          monete += p[i];
        } else {
          monete += m / (long long)(pow(2, i));
          m -= (long long)(pow(2, i)) * (m / (long long)(pow(2, i)));
        }
      }
      i--;
    }
    if (m != 0)
      cout << "-1\n";
    else
      cout << monete << "\n";
  }
  return 0;
}
