#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q, maxn = -1, ans = 0;
  cin >> n >> q;
  int vet[40];
  memset(vet, 0, sizeof(vet));
  while (n--) {
    int x;
    cin >> x;
    vet[(int)(log2(x))]++;
  }
  while (q--) {
    int cont;
    cin >> cont;
    ans = 0;
    for (int i = 30; i >= 0 && cont > 0; i--) {
      ans += min(cont >> i, vet[i]);
      cont -= min(cont >> i, vet[i]) * (1 << i);
    }
    if (cont == 0)
      cout << ans << endl;
    else
      cout << "-1" << endl;
  }
  return 0;
}
