#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
const long long Maxn = 1e9 + 7;
long long ma[maxn];
long long ans = 0;
long long quick_pow(long long x, long long p) {
  long long ant = 1;
  while (p) {
    if (p & 1) {
      ant = ant * x;
    }
    x = x * x;
    p = p >> 1;
  }
  return ant;
}
int main() {
  memset(ma, 0, sizeof(ma));
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    long long y = log2(x);
    ans = max(ans, y);
    ma[y]++;
  }
  while (q--) {
    long long a;
    long long s = 0;
    scanf("%lld", &a);
    for (int i = ans; i >= 0; i--) {
      if (ma[i] == 0) {
        continue;
      }
      if (a == 0) {
        break;
      }
      long long x = quick_pow(2, i);
      if (x > a) {
        continue;
      }
      long long sum = ma[i];
      if (a / x > sum) {
        s += sum;
        a -= (sum * x);
      } else {
        s += (a / x);
        a %= x;
      }
    }
    if (a != 0) {
      printf("-1\n");
    } else {
      printf("%lld\n", s);
    }
  }
  return 0;
}
