#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);
  map<int, int> mp, pm;
  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]++;
  }
  for (int i = 0; i < 32; i++) mp[i] = dp[i];
  for (int i = 0; i <= 31; i++) {
    int x = dp[i];
    for (int j = i + 1; j <= 32; j++) dp[j] += x / 2, x /= 2;
  }
  while (q--) {
    int x, f = 0;
    cin >> x;
    for (int i = 0; i <= 32; i++)
      if ((x & (1 << i)) && !dp[i]) {
        cout << -1 << endl;
        f = 1;
        break;
      }
    if (!f) {
      int ans = 0;
      pm = mp;
      for (int i = 32; i >= 0 && x; i--) {
        if (x > 0) x -= (1 << i) * pm[i], ans += pm[i], pm[i] = 0;
        if (x < 0) {
          int ex = abs(x);
          ex = ceil(1.0 * ex / (1 << i));
          pm[i] = ex;
          ans -= ex;
          x += ex * (1 << i);
        }
        if (x == 0) break;
      }
      cout << ans << endl;
    }
  }
}
