#include <bits/stdc++.h>
using namespace std;
int scnt[31];
int main() {
  int n, q;
  cin >> n >> q;
  while (n--) {
    int t;
    cin >> t;
    scnt[(int)log2(t)]++;
  }
  while (q--) {
    int in;
    cin >> in;
    int c = 0;
    for (int i = 30; i >= 0; --i) {
      int p = 1 << i;
      int t = min(in / p, scnt[i]);
      in -= t * p;
      c += t;
      if (!in) break;
    }
    if (in)
      cout << -1 << endl;
    else
      cout << c << endl;
  }
  return 0;
}
