#include <bits/stdc++.h>
using namespace std;
int const N = 200001;
int n, q, v[N], f[32];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; ++i) {
    scanf("%d", v + i);
    int dg = log2(v[i]);
    ++f[dg];
  }
  while (q--) {
    int x;
    scanf("%d", &x);
    int an = 0;
    for (int j = 30; j >= 0 && x > 0; --j) {
      int ad = min((int)(x / pow(2, j)), f[j]);
      x -= ad * pow(2, j);
      an += ad;
    }
    printf("%d\n", x ? -1 : an);
  }
}
