#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q, i, x, r = 1, b[32], ans;
  cin >> n >> q;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  map<long long, long long> m1, m2;
  for (i = 0; i < 60; i++) {
    m1[r] = i;
    r = r * 2;
  }
  for (i = 0; i < n; i++) m2[m1[a[i]]]++;
  while (q--) {
    cin >> x;
    ans = 0;
    for (i = 0; i < 32; i++) {
      b[i] = x % 2;
      x = x / 2;
    }
    for (i = 31; i > 0; i--) {
      if (m2[i] < b[i])
        b[i - 1] += (b[i] - m2[i]) * 2, ans += m2[i];
      else
        ans += b[i];
    }
    if (m2[0] >= b[0])
      cout << ans + b[0] << "\n";
    else
      cout << "-1\n";
  }
  return 0;
}
