#include <bits/stdc++.h>
using namespace std;
long long lb(vector<long long> v, long long lo, long long hi, long long ele) {
  long long ans = -1;
  while (lo <= hi) {
    long long md = (lo + hi) / 2;
    if (v[md] <= ele) {
      ans = md;
      lo = md + 1;
    } else
      hi = md - 1;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, q;
  cin >> n >> q;
  vector<long long> v(n);
  map<long long, long long> cnt;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    cnt[v[i]]++;
  }
  while (q--) {
    long long k, ans = 0;
    cin >> k;
    for (long long i = 30; i >= 0; i--) {
      long long zz = pow(2, i);
      if (cnt[zz] > 0) {
        long long ts = min(cnt[zz], k / zz);
        ans += ts;
        k -= zz * ts;
      }
    }
    if (k > 0) ans = -1;
    cout << ans << endl;
  }
  return 0;
}
