#include <bits/stdc++.h>
using namespace std;
long long n, q;
long long a[45], f[250000];
void init() {
  while (q--) {
    long long m, sum = 0;
    scanf("%lld", &m);
    for (int i = 33; i >= 0; i--) {
      if (m >= a[i]) {
        if (m / a[i] >= f[i]) {
          sum += f[i];
          m -= f[i] * a[i];
        } else {
          sum += m / a[i];
          m -= (m / a[i]) * a[i];
        }
      }
    }
    if (m == 0)
      printf("%lld\n", sum);
    else
      printf("-1\n");
  }
}
int main() {
  a[0] = 1;
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= 33; i++) a[i] = a[i - 1] * 2;
  scanf("%lld%lld", &n, &q);
  for (int i = 1; i <= n; i++) {
    long long t;
    scanf("%lld", &t);
    long long d, id;
    d = 1, id = 0;
    while (d != t) {
      d *= 2;
      id++;
    }
    f[id]++;
  }
  init();
  return 0;
}
