#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q, c, res, i;
  cin >> n >> q;
  vector<long long> freq(32, 0);
  for (i = 0; i < n; i++) {
    cin >> c;
    int idx = 31;
    while (!(c & (1 << idx))) idx--;
    freq[idx]++;
  }
  while (q--) {
    scanf("%I64d", &c);
    long long idx = 31, cur;
    res = 0;
    while (c && idx >= 0) {
      cur = min(c / (1 << idx), freq[idx]);
      res += cur;
      c -= cur * (1 << idx);
      idx--;
    }
    if (c == 0)
      printf("%I64d\n", res);
    else
      printf("-1\n");
  }
}
