#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  map<int, int> cnt;
  for (int i = 0; i < n; ++i) {
    int v;
    cin >> v;
    cnt[v]++;
  }
  while (q--) {
    int v;
    cin >> v;
    int ans = 0;
    for (int i = 30; i >= 0; --i) {
      int cnt1 = v / (1ll << i);
      ans += min(cnt1, cnt[(1ll << i)]);
      v -= min(cnt1, cnt[(1ll << i)]) * (1ll << i);
    }
    if (v == 0) {
      cout << ans << '\n';
    } else {
      cout << -1 << '\n';
    }
  }
  return 0;
}
