#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
map<int, int> ans;
int a, cnt, n, q, t, que;
map<int, int>::reverse_iterator ii;
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a;
    mp[a]++;
  }
  while (q--) {
    cin >> que;
    cnt = 0;
    for (ii = mp.rbegin(); ii != mp.rend() && que > 0; ii++) {
      if (que >= ii->second * ii->first) {
        cnt += ii->second;
        que -= ii->second * ii->first;
      } else {
        cnt += que / ii->first;
        que -= que / ii->first * ii->first;
      }
    }
    if (que) {
      cout << -1 << endl;
    } else
      cout << cnt << endl;
  }
}
