#include <bits/stdc++.h>
using namespace std;
int a[33] = {0};
int main() {
  ios::sync_with_stdio(0);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    int p;
    cin >> p;
    int m = (log(p) / log(2) + 0.5);
    a[m] += 1;
  }
  while (q--) {
    int p;
    cin >> p;
    int l = (log(p) / log(2) + 0.5);
    int cnt = 0;
    for (int i = l; i >= 0; i--) {
      int po = 1 << i;
      if (po > p) continue;
      if (a[i] > 0) {
        cnt += (min((int)(p / po), a[i]));
        p -= ((po) * (int)(min((int)(p / po), a[i])));
      }
    }
    if (p > 0) {
      cout << "-1" << endl;
      ;
    } else {
      cout << cnt << endl;
    }
  }
  return 0;
}
