#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  map<int, int> coin;
  vector<int> v;
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    if (!coin[x]) v.push_back(x);
    coin[x]++;
  }
  sort(v.rbegin(), v.rend());
  for (int i = 0, x, ans; i < q; ++i) {
    cin >> x;
    ans = 0;
    for (int j = 0; j < (int)v.size() and x != 0; ++j) {
      int coins = v[j];
      int numb = coin[coins];
      int mn = min(numb, x / coins);
      x -= (mn * coins);
      ans += mn;
    }
    if (x)
      cout << "-1\n";
    else
      cout << ans << "\n";
  }
  return 0;
}
