#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
void solve() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < int(n); i++) cin >> arr[i];
  map<int, int> m;
  set<int> s;
  for (int i = 0; i < int(n); i++) {
    m[arr[i]]++;
    s.insert(arr[i]);
  }
  while (k--) {
    int a;
    cin >> a;
    int ans = 0;
    for (auto it = s.rbegin(); it != s.rend(); it++) {
      int cur = *it;
      int need = a / cur;
      int have = m[cur];
      int xx = min(need, have);
      a -= cur * xx;
      ans += xx;
    }
    if (a == 0) {
      cout << ans << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
