#include <bits/stdc++.h>
using namespace std;
int mu[123123], cnt[123123], a[123123], n, res, q, m;
int main() {
  cin >> n >> q;
  mu[0] = 1;
  for (int i = 1; i < 31; i++) mu[i] = mu[i - 1] * 2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < 31; j++)
      if (a[i] == mu[j]) cnt[j]++;
  }
  while (q--) {
    cin >> n;
    res = 0;
    for (int i = 30; i >= 0; i--) {
      m = min(n / mu[i], cnt[i]);
      res += m;
      n -= m * mu[i];
    }
    if (n == 0)
      cout << res << "\n";
    else
      cout << "-1"
           << "\n";
  }
  return 0;
}
