#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a;
map<long long, long long> q;
map<long long, long long>::reverse_iterator rii;
void solve() {
  long long x;
  cin >> x;
  long long ost = x, ans = 0;
  long long z = 0;
  rii = q.rbegin();
  while (true) {
    z++;
    long long one = rii->first, two = rii->second;
    long long full = min(ost / one, two);
    ost -= (full * one);
    ans += full;
    rii++;
    if (ost == 0) {
      cout << ans << endl;
      return;
    }
    if (z == q.size() + 1) {
      cout << -1 << endl;
      return;
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, m;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    long long z;
    cin >> z;
    q[z]++;
    a.push_back(z);
  }
  while (m--) {
    solve();
  }
  return 0;
}
