#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  long long n, q;
  cin >> n >> q;
  long long count[32] = {0};
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    long long z = log2(x);
    count[z]++;
  }
  while (q--) {
    long long b;
    cin >> b;
    long long cnt = 0;
    for (long long i = 31; i >= 0; i--) {
      long long j = pow(2, i);
      long long req = b / j;
      if (req > count[i]) {
        b = b - count[i] * j;
        cnt += count[i];
      } else {
        b = b - req * j;
        cnt += req;
      }
    }
    if (b == 0)
      cout << cnt << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
