#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, q, sum, res = 0, val, curr;
  cin >> n >> q;
  vector<long long> a(n);
  map<long long, long long> powers;
  map<long long, long long>::reverse_iterator it;
  for (i = 0; i < n; i++) {
    cin >> val;
    powers[val] += val;
  }
  for (i = 1; i <= q; i++) {
    cin >> sum;
    res = 0;
    for (it = powers.rbegin(); it != powers.rend(); it++) {
      if (sum) {
        if (sum >= it->second) {
          sum -= it->second;
          res += (it->second / it->first);
        } else {
          val = sum / it->first;
          sum -= (val * it->first);
          res += val;
        }
      } else
        break;
    }
    if (sum)
      cout << "-1\n";
    else
      cout << res << "\n";
  }
  return 0;
}
