#include <bits/stdc++.h>
using namespace std;
const int MaxN = 2e5 + 2;
int n, q, a[MaxN];
int cnt[35];
unsigned int pow_2[35];
void init() {
  pow_2[0] = 1;
  for (int i = 1; i < 32; i++) pow_2[i] = pow_2[i - 1] << 1;
}
int main() {
  init();
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    cnt[(int)(log(a[i]) / log(2))]++;
  }
  bool flag = cnt[0];
  while (q--) {
    int x;
    scanf("%d", &x);
    if (!flag && x % 2) {
      printf("-1\n");
      continue;
    }
    int ans = 0;
    for (int i = 29; i >= 0; i--) {
      if (cnt[i] && x >= pow_2[i]) {
        int y = x / pow_2[i];
        y = y > cnt[i] ? cnt[i] : y;
        x -= pow_2[i] * y;
        ans += y;
      }
      if (!x) break;
    }
    if (x)
      printf("-1\n");
    else
      printf("%d\n", ans);
  }
  return 0;
}
