#include <bits/stdc++.h>
using namespace std;
map<int, int> mm;
int n, q;
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    mm[t]++;
  }
  while (q--) {
    int b;
    int cnt = 0;
    cin >> b;
    if (!mm.size()) {
      cout << -1 << endl;
      return 0;
    }
    auto it = mm.end();
    --it;
    while (1) {
      int mmin = min(b / it->first, it->second);
      cnt += mmin;
      b -= mmin * it->first;
      if (!b) {
        cout << cnt << endl;
        break;
      }
      if (it == mm.begin() && b != 0) {
        cout << -1 << endl;
        break;
      }
      --it;
    }
  }
  return 0;
}
