#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<int> v(30, 0);
  int n, q, s = 0;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int j;
    cin >> j;
    v[31 - __builtin_clz(j)]++;
  }
  for (int i = 0; i < q; i++) {
    int j, ans = 0;
    cin >> j;
    for (int k = 29; k >= 0 && j > 0; k--) {
      int need = min(j >> k, v[k]);
      ans += need;
      j -= (1 << k) * need;
    }
    if (j == 0) {
      cout << ans << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
