#include <bits/stdc++.h>
using namespace std;
const int con = 2e5;
int Pow[31], bin[31], cnt[31];
int main() {
  Pow[0] = 1;
  for (int i = 1; i < 31; ++i) Pow[i] = 2 * Pow[i - 1];
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    for (int j = 0; j < 31; ++j) {
      if (t == Pow[j]) {
        ++cnt[j];
        break;
      }
    }
  }
  for (int i = 0; i < q; ++i) {
    int b, res = 0;
    vector<int> v;
    cin >> b;
    int tmp = b;
    while (tmp > 0) {
      v.push_back(tmp % 2);
      tmp /= 2;
    }
    int d = v.size() - 1, p = d;
    while (b != 0 and p > 0) {
      int dd = min(v[p], cnt[p]);
      b -= dd * Pow[p];
      v[p] -= dd;
      res += dd;
      v[p - 1] += v[p] * 2;
      --p;
    }
    if (b != 0)
      cout << -1;
    else
      cout << res;
    cout << endl;
  }
}
