#include <bits/stdc++.h>
using namespace std;
map<long long, long long> m;
long long solve(long long val) {
  long long ans = 0;
  for (long long t = 1 << 30; t >= 1; t = t >> 1) {
    long long now = min(m[t], val / t);
    ans += now;
    val -= (now * t);
  }
  if (val != 0) {
    return -1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, q;
  cin >> n >> q;
  for (long long i = 0; i < n; i++) {
    long long val;
    cin >> val;
    m[val]++;
  }
  while (q--) {
    long long query;
    cin >> query;
    cout << solve(query) << '\n';
  }
  return 0;
}
