#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, q;
  cin >> n >> q;
  map<long long int, long long int> cnt;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    long long int a;
    cin >> a;
    cnt[a]++;
  }
  while (q--) {
    long long int b;
    cin >> b;
    long long int res = 0;
    long long int ans = 0;
    for (long long int i = 31; i >= 0; i--) {
      if (b & (1 << i)) {
        res += (1 << i);
      }
      if (cnt[(1 << i)] * (1 << i) >= res) {
        long long int x = (res) / (1 << i);
        res = res - (1 << i) * x;
        ans += x;
      } else {
        long long int y = cnt[(1 << i)];
        res = res - (1 << i) * y;
        ans += y;
      }
      res *= 2;
    }
    if (res == 0) {
      cout << ans << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
