#include <bits/stdc++.h>
int a[32] = {0}, b[32];
int main() {
  int n, q, c, x, i, s;
  scanf("%d%d", &n, &q);
  while (n--) {
    c = 0;
    scanf("%d", &x);
    while (x > 1) x >>= 1, c++;
    a[c]++;
  }
  while (q--) {
    scanf("%d", &x);
    i = 0, s = 0;
    while (x) {
      b[i++] = x & 1;
      x >>= 1;
    }
    for (i--; i > 0; i--) {
      if (b[i] <= a[i])
        s += b[i];
      else
        s += a[i], b[i - 1] += (b[i] - a[i]) << 1;
    }
    if (b[0] <= a[0])
      printf("%d\n", s + b[0]);
    else
      puts("-1");
  }
  return 0;
}
