#include <bits/stdc++.h>
using namespace std;
int n, q;
const int MAXN = 200005;
map<long long, long long> occ;
set<long long> a;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.insert(x);
    occ[x]++;
  }
  for (int i = 0; i < q; i++) {
    long long b;
    cin >> b;
    bool done = false;
    int ans = 0;
    while (b > 0) {
      set<long long>::iterator it = a.upper_bound(b);
      if (it == a.begin()) {
        done = true;
        break;
      }
      it--;
      long long x = *it;
      if (b / x >= occ[x]) {
        b -= occ[x] * x;
        ans += occ[x];
      } else {
        ans += b / x;
        b %= x;
      }
    }
    if (done)
      cout << -1 << "\n";
    else
      cout << ans << "\n";
  }
  return 0;
}
