#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long s[40] = {0};
  long long a, n, q;
  cin >> n >> q;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    s[(long long)log2(a)]++;
  }
  while (q--) {
    cin >> a;
    long long t = 33, cnt = 0;
    while (a > 0 && t >= 0) {
      cnt += min(a / (1 << t), s[t]);
      a -= min(a / (1 << t), s[t]) * (1 << t);
      t--;
    }
    if (a == 0)
      cout << cnt << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
