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