#include <bits/stdc++.h>
using namespace std;
string dtob(long long int n) {
  string r = "";
  long long int t = n;
  while (n > 0) {
    r = to_string(n % 2) + r;
    n /= 2;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, q;
  cin >> n >> q;
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    m[x] += 1;
  }
  vector<pair<int, int> > v1;
  map<long long int, long long int>::iterator itr;
  for (itr = m.begin(); itr != m.end(); itr++)
    v1.insert(v1.begin(), make_pair(itr->first, itr->second));
  for (int i = 0; i < q; i++) {
    int x;
    cin >> x;
    int ind = 0, res = 0;
    vector<pair<int, int> > v = v1;
    while (ind < v.size() and x > 0) {
      if (x <= v[ind].first * v[ind].second) {
        int need = x / v[ind].first;
        res += need;
        x -= need * v[ind].first;
        v[ind].second -= need;
      } else {
        res += v[ind].second;
        x -= v[ind].first * v[ind].second;
        v[ind].second = 0;
      }
      ind += 1;
    }
    if (x == 0)
      cout << res << endl;
    else
      cout << "-1" << endl;
  }
}
