#include <bits/stdc++.h>
using namespace std;
map<long long, long long> m;
long long getPow2(long long val) {
  long long counter = 0;
  while (val) {
    val /= 2;
    ++counter;
  }
  return counter;
}
long long solve(long long val) {
  long long sqRt = getPow2(val);
  --sqRt;
  long long ans = 0;
  while (val > 0 && sqRt > 0) {
    long long now = pow(2, sqRt);
    long long canTake = (val / now);
    ans += canTake;
    val -= (now * canTake);
    sqRt--;
  }
  if (val > 0) {
    return -1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, q;
  cin >> n >> q;
  for (long long i = 0; i < n; i++) {
    long long val;
    cin >> val;
    m[val]++;
  }
  while (q--) {
    long long query;
    cin >> query;
    cout << solve(query) << '\n';
  }
  return 0;
}
