#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long md) {
  long long res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x = (x * x) % md;
    y = y >> 1;
  }
  return res % md;
}
int main() {
  long long n, q;
  cin >> n >> q;
  map<long long, long long> m;
  long long x;
  for (long long i = 0; i < n; ++i) {
    cin >> x;
    m[x]++;
  }
  long long ans = 0;
  while (q--) {
    ans = 0;
    long long x;
    cin >> x;
    bool flag = true;
    auto it = m.end();
    it--;
    while (x > 0 && it != m.begin()) {
      long long a = x / it->first;
      if (a > it->second) a = it->second;
      x -= a * it->first;
      ans += a;
      it--;
    }
    if (x != 0 && it == m.begin()) {
      long long a = x / it->first;
      if (a > it->second) a = it->second;
      x -= a * it->first;
      ans += a;
    }
    if (x == 0) {
      cout << ans << endl;
    } else
      cout << -1 << endl;
  }
}
