#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, q;
  cin >> n >> q;
  vector<long long> v;
  long long x = 1;
  v.push_back(x);
  for (int i = 1; i <= 32; ++i) {
    x *= 2;
    v.push_back(x);
  }
  map<long long, int> us;
  for (int i = 1; i <= n; ++i) {
    long long a;
    cin >> a;
    ++us[a];
  }
  while (q--) {
    long long b;
    cin >> b;
    int ans = 0;
    for (int i = v.size() - 1; i >= 0; --i) {
      int j = b / v[i];
      j = min(j, us[v[i]]);
      b -= j * v[i];
      ans += j;
    }
    if (b != 0)
      cout << -1 << '\n';
    else
      cout << ans << '\n';
  }
  return 0;
}
