#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int main() {
  int n, q, tmp, cnt, ans;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> tmp;
    m[tmp]++;
  }
  map<int, int>::iterator it;
  for (int i = 1; i <= q; i++) {
    cin >> tmp;
    ans = 0;
    it = --m.end();
    while (tmp) {
      int cnt = min(tmp / it->first, it->second);
      ans += cnt;
      tmp -= (it->first) * cnt;
      if (tmp == 0) {
        cout << ans << endl;
        break;
      } else if (it == m.begin()) {
        cout << -1 << endl;
        break;
      }
      it--;
    }
  }
  return 0;
}
