#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, q, x;
  cin >> n >> q;
  map<long long, long long> p;
  for (int i = 0; i < n; i++) {
    cin >> x;
    p[x]++;
  }
  while (q--) {
    long long st = 0;
    cin >> x;
    long long k = x;
    auto it = p.end();
    do {
      it--;
      if (!k) break;
      long long f = it->first;
      long long s = it->second;
      if (k >= f) {
        long long v = min(k / f, s);
        st += v;
        k -= (v * f);
      }
    } while (it != p.begin());
    if (!k)
      cout << st << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
