#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[40] = {0};
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    int cifang = log2(x);
    a[cifang]++;
  }
  while (q--) {
    int b;
    cin >> b;
    int ans = 0;
    for (int i = 31; i >= 0; i--) {
      int t = min(a[i], b / (1 << i));
      ans += t;
      b -= (1 << i) * t;
    }
    if (b != 0) ans = -1;
    cout << ans << endl;
  }
  return 0;
}
