#include <bits/stdc++.h>
using namespace std;
void fun(long long n, vector<long long>& v) {
  long long i;
  if (n == 0) return;
  long long cnt = 0;
  long long tmp = 1;
  for (i = 1; i < 32; i++) {
    if (tmp * 2 > n)
      break;
    else
      cnt++, tmp *= 2;
  }
  v[cnt]++;
  fun(n - tmp, v);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, q, i, j;
  cin >> n >> q;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  vector<long long> p(32);
  for (i = 0; i < n; i++) {
    long long tmp = a[i];
    long long pw = 0;
    while (tmp != 1) {
      tmp /= 2;
      pw++;
    }
    p[pw]++;
  }
  while (q--) {
    long long b;
    cin >> b;
    vector<long long> v(32);
    fun(b, v);
    for (i = v.size() - 1; i > 0; i--) {
      if (v[i] > p[i]) {
        long long tmp = v[i] - p[i];
        v[i] = p[i];
        v[i - 1] = 2 * tmp;
      }
    }
    if (v[0] > p[0])
      cout << -1 << endl;
    else {
      long long cnt = 0;
      for (i = 0; i < v.size(); i++) cnt += v[i];
      cout << cnt << endl;
    }
  }
}
