#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int n, k;
  cin >> n >> k;
  map<int, int> h;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    h[-x]++;
  }
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    int cur = 0;
    for (auto it : h) {
      int p = (-it.first);
      int k = min(x / p, it.second);
      x -= p * k;
      cur += k;
    }
    if (x)
      cout << -1 << "\n";
    else
      cout << cur << "\n";
  }
}
