#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long int n, q;
  cin >> n >> q;
  vector<long long int> a(32, 0);
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    for (long long int i = 0; i < 32; i++) {
      if (x & (1ll << i)) {
        a[i]++;
        break;
      }
    }
  }
  while (q--) {
    long long int x;
    cin >> x;
    long long int ans = 0;
    for (long long int i = 31; i >= 0; i--) {
      long long int need = min(x / (1ll << i), a[i]);
      ans += need;
      x -= need * (1ll << i);
    }
    if (x > 0)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
}
