#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  set<int> s;
  vector<int> ve;
  int n, q;
  cin >> n >> q;
  int ar[n], l = s.size();
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    m[ar[i]]++;
    s.insert(ar[i]);
    if (s.size() > l) {
      ve.push_back(ar[i]);
      l = s.size();
    }
  }
  sort(ve.begin(), ve.end(), greater<int>());
  while (q--) {
    int a, k, s = 0;
    cin >> a;
    for (int i = 0; i < ve.size(); i++) {
      k = min(m[ve[i]], a / ve[i]);
      s += k;
      a -= (k * ve[i]);
    }
    if (a != 0)
      cout << -1 << endl;
    else
      cout << s << endl;
  }
  return 0;
}
