#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> arr(33, 0);
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    for (long long j = 0; j < 31; j++) {
      if (a & (1 << j)) arr[j]++;
    }
  }
  vector<long long> t = arr;
  while (k--) {
    long long a;
    cin >> a;
    bool check = true;
    long long ans = 0;
    for (long long j = 30; j >= 0; j--) {
      long long h = a / (1 << j);
      ans += min(h, t[j]);
      a -= min(h, t[j]) * (1 << j);
    }
    if (a == 0)
      cout << ans << "\n";
    else
      cout << -1 << "\n";
  }
  cout << "\n";
  return 0;
}
