#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, t;
  cin >> n >> t;
  long long a[n], power[31] = {0};
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    long long x = __builtin_ctz(a[i]);
    power[x]++;
  }
  while (t--) {
    long long q, cnt = 0, ans = 0;
    cin >> q;
    for (int i = 30; i >= 0; i--) {
      long long cmp = pow(2, i);
      cnt = min(q / cmp, power[i]);
      ans += cnt;
      if (cnt > 0) {
        q -= (cmp * cnt);
      }
    }
    if (q == 0) {
      cout << ans << "\n";
    } else {
      cout << -1 << "\n";
    }
  }
  return 0;
}
