#include <bits/stdc++.h>
long long ary[32];
int main(void) {
  int n, q;
  scanf("%d %d", &n, &q);
  int i, j;
  for (i = 0; i < n; ++i) {
    long long x;
    scanf("%lld", &x);
    for (j = 0; j < 32; ++j) {
      if (1 << j == x) {
        ary[j] += 1;
        break;
      }
    }
  }
  while (q--) {
    long long b, ans = 0;
    scanf("%lld", &b);
    for (i = 31; i >= 0; --i) {
      long long a = (long long)1 << i;
      if (a > b || !ary[i]) continue;
      if (a * ary[i] <= b) {
        ans += ary[i];
        b -= a * ary[i];
      } else {
        ans += 1;
        b -= a;
      }
    }
    if (b) ans = -1;
    printf("%lld\n", ans);
  }
}
