#include <bits/stdc++.h>
using namespace std;
long long mapa[35];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 30; j >= 0; j--)
      if ((1 << j) & x) {
        mapa[j]++;
        break;
      }
  }
  while (q--) {
    int x;
    scanf("%d", &x);
    long long pos = 0, res = 0;
    for (int i = 30; i >= 0; i--) {
      long long b = (1 << i);
      if (b > x) continue;
      long long aux = min(mapa[i], (long long)x / b);
      res += aux;
      x -= b * aux;
    }
    if (x > 0)
      printf("-1\n");
    else
      printf("%lld\n", res);
  }
  return 0;
}
