#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, q;
  cin >> n >> q;
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++m[x];
  }
  for (int i = 0; i < q; ++i) {
    int v, ans = 0;
    cin >> v;
    for (auto it = m.rbegin(); it != m.rend() && v > 0; ++it) {
      int k = min(it->second, v / it->first);
      v -= k * it->first;
      ans += k;
    }
    if (v > 0) {
      ans = -1;
    }
    cout << ans << '\n';
  }
}
