#include <bits/stdc++.h>
using namespace std;
int n;
int q;
map<long long, long long> e;
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (e.find(x) == e.end())
      e[x] = 1;
    else {
      e[x]++;
    }
  }
  while (q--) {
    long long x;
    cin >> x;
    long long k = (1 << 30ll);
    long long moves = 0;
    while (k > 0) {
      long long need = min(e[k], x / k);
      moves += need;
      x -= k * need;
      k >>= 1ll;
    }
    if (x > 0) {
      puts("-1");
    } else {
      cout << moves << '\n';
    }
  }
}
