#include <bits/stdc++.h>
using namespace std;
long long freq[40];
int n, q;
int lg(long long n) {
  int ans = 0;
  while (n > 1) {
    ans++;
    n /= 2;
  }
  return ans;
}
long long pw(int n) {
  long long ans = 1;
  for (int i = 0; i < n; i++) ans *= 2;
  return ans;
}
int calc(long long n) {
  int ans = 0;
  for (int i = 40; i >= 0; i--) {
    long long p = pw(i);
    long long t = min(n / p, freq[i]);
    ans += t;
    n -= t * p;
  }
  if (n > 0) return -1;
  return ans;
}
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    freq[lg(t)]++;
  }
  for (int qq = 0; qq < q; qq++) {
    long long t;
    cin >> t;
    cout << calc(t) << endl;
  }
  return 0;
}
