#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 10;
int dp[64];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i <= 32; i++) {
    for (int j = 0; j < n; j++)
      if (a[j] & (1 << i)) dp[i]++;
  }
  while (q--) {
    int x;
    cin >> x;
    int ans = 0;
    for (int i = 32; i >= 0 && x; i--) {
      if (x > 0) x -= (1 << i) * dp[i], ans += dp[i];
      if (x < 0) {
        int ex = abs(x);
        ex = ceil(1.0 * ex / (1 << i));
        ans -= ex;
        x += ex * (1 << i);
      }
      if (x == 0) break;
    }
    if (x == 0)
      cout << ans << endl;
    else
      cout << -1 << endl;
  }
}
