#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
void solve() {
  long long n, q;
  cin >> n >> q;
  vector<long long> v(n);
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
  }
  for (long long i = 0; i < q; i++) {
    long long tp;
    cin >> tp;
    long long ans = 0;
    for (long long i = 30; i >= 0 and tp > 0; i--) {
      long long minus = min(tp / (1ll << i), mp[1ll << i]);
      ans += minus;
      tp -= minus * (1 << i);
    }
    if (tp)
      cout << -1;
    else
      cout << ans;
    cout << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) solve();
  return 0;
}
