#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
unordered_map<ll, ll> f;
void check() {
  ll m, cnt = 0;
  unordered_map<ll, ll> u;
  cin >> m;
  while (m > 0) {
    ll b = m & (-m), nb;
    m -= b;
    if (f[b] - u[b] > 0) {
      u[b]++;
      cnt++;
      b = 0;
    } else if (f[b] == 0) {
      nb = b;
      while (nb > 0 && b > 0) {
        nb /= 2;
        if (f[nb] - u[nb] > 0) {
          ll uc = min(f[nb] - u[nb], b / nb);
          cnt += uc;
          b -= uc * nb;
          u[nb] += uc;
        }
      }
    }
    if (b) {
      cout << "-1\n";
      return;
    }
  }
  cout << cnt << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, q, x;
  cin >> n >> q;
  for (ll i = 0; i < n; i++) {
    cin >> x;
    f[x]++;
  }
  for (ll i = 0; i < q; i++) {
    check();
  }
  return 0;
}
