#include <bits/stdc++.h>
#pragma GCC optimize("03")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, q, d, d1, d2, cnt, x;
  map<long long int, long long int> mp;
  set<long long int> ss, ss1;
  cin >> n >> q;
  for (long long int i = 1; i <= n; i++) {
    cin >> x;
    mp[x] += 1;
    ss.insert(x);
  }
  while (q--) {
    cin >> x;
    ss1 = ss;
    cnt = 0;
    while (x > 0 && !ss1.empty()) {
      auto it = ss1.upper_bound(x);
      if (it == ss1.begin()) break;
      it--;
      d = *it;
      d1 = x / d;
      d2 = min(mp[d], d1);
      x -= d2 * d;
      ss1.erase(it);
      cnt += d2;
    }
    if (x)
      cout << -1 << "\n";
    else
      cout << cnt << "\n";
  }
  return 0;
}
