#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  map<int, int, greater<int>> m;
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  while (q--) {
    int a;
    cin >> a;
    if (a % 2 != 0) {
      cout << -1 << "\n";
      continue;
    }
    int ans = 0;
    for (auto p : m) {
      if (p.first > a) continue;
      int b = min(p.second, a / p.first);
      a -= b * p.first;
      ans += b;
    }
    if (a)
      cout << -1 << "\n";
    else
      cout << ans << "\n";
  }
  return 0;
}
