#include <bits/stdc++.h>
using namespace std;
const int N = 32;
int sum[N], n, q, x;
int main() {
  cin >> n >> q;
  while (n--) {
    cin >> x;
    sum[(int)log2(x)]++;
  }
  while (q--) {
    int tmp, xx, x, ans = 0;
    cin >> tmp;
    for (int i = N - 1; i >= 0; i--) {
      x = tmp / (1 << i);
      xx = min(x, sum[i]);
      tmp -= xx * (1 << i);
      ans += xx;
    }
    (tmp == 0) ? cout << ans << endl : cout << "-1" << endl;
  }
  return 0;
}
