#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, q;
  cin >> n >> q;
  long long int a[n];
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  map<long long int, long long int>::iterator itr;
  while (q--) {
    long long int b;
    long long int count = 0;
    cin >> b;
    for (auto itr = m.rbegin(); itr != m.rend(); ++itr) {
      if (b >= itr->first) {
        long long num = b / itr->first;
        if (num <= itr->second) {
          b -= num * itr->first;
          count += num;
        } else {
          b -= (itr->second) * (itr->first);
          count += itr->second;
        }
      }
    }
    if (b != 0)
      cout << -1 << endl;
    else
      cout << count << endl;
  }
  return 0;
}
