#include <bits/stdc++.h>
using namespace std;
long long a[50], b[50];
int Find(long long x) {
  int num = -1;
  while (x) {
    num++;
    x >>= 1;
  }
  return num;
}
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    long long t;
    scanf("%lld", &t);
    int idx = Find(t);
    b[idx]++;
  }
  for (int i = 1; i <= q; i++) {
    long long ans = 0, t;
    scanf("%lld", &t);
    for (int j = 0; j <= 35; j++) a[j] = 0;
    int idx = 0;
    while (t) {
      if (t & 1) a[idx] = 1;
      t >>= 1;
      idx++;
    }
    for (int j = 35; j >= 0; j--) {
      if (a[j]) {
        if (a[j] > b[j]) {
          ans += b[j];
          if (j) {
            a[j - 1] += (a[j] - b[j]) << 1;
            a[j] = 0;
          } else
            a[j] -= b[j];
        } else {
          ans += a[j];
          a[j] = 0;
        }
      }
    }
    if (a[0])
      printf("-1\n");
    else
      printf("%lld\n", ans);
  }
  return 0;
}
