#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int mx = 2e5 + 1000;
int powerof2(int a) {
  int i, tmp = 1;
  for (i = 0; tmp <= a; i++) tmp *= 2;
  return i - 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, tmp, q, qi, ans;
  int a[32], b[32];
  memset(a, 0, sizeof(a));
  cin >> n >> q;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> tmp;
    a[powerof2(tmp)] += 1;
  }
  copy(a, a + 32, b);
  for (int(i) = 0; (i) < (q); (i)++) {
    copy(b, b + 32, a);
    cin >> qi;
    ans = 0;
    tmp = powerof2(qi);
    while (tmp != 0 && qi > 0) {
      if (a[tmp] > 0) {
        qi -= pow(2, tmp);
        a[tmp] -= 1;
        tmp = powerof2(qi);
        ans += 1;
      } else {
        tmp--;
      }
    }
    if (qi > 0)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
