#include <bits/stdc++.h>
using namespace std;
int n, q, b[105], a, c[105], d, ans;
int main() {
  int i, j;
  scanf("%d%d", &n, &q);
  b[0] = 1;
  for (i = 1; i <= 30; i++) b[i] = b[i - 1] << 1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    for (j = 0; j <= 30; j++)
      if (a == b[j]) c[j]++;
  }
  for (i = 1; i <= q; i++) {
    ans = 0;
    scanf("%d", &a);
    for (j = 30; j >= 0; j--) {
      if (b[j] > a) continue;
      d = a / b[j];
      d = min(d, c[j]);
      a -= b[j] * d;
      ans += d;
    }
    if (a != 0) {
      printf("-1\n");
      continue;
    }
    printf("%d\n", ans);
  }
  return 0;
}
