#include <bits/stdc++.h>
using namespace std;
void syntex_error() {
  long long i, j, k, l, r, n, m, a, b, c, x, y, z, sum = 0LL, total;
  map<long long, long long> mp;
  cin >> n >> m;
  for (i = 0; i < n; ++i) {
    long long xx;
    cin >> xx;
    mp[xx]++;
  }
  while (m--) {
    cin >> x;
    total = 0;
    for (auto it = mp.rbegin(); it != mp.rend(); it++) {
      a = min(x / it->first, it->second);
      total += a;
      x -= (it->first) * a;
    }
    if (!x)
      cout << total << "\n";
    else
      cout << -1 << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long TC = 1LL;
  while (TC--) {
    syntex_error();
  }
  return 0;
}
