#include <bits/stdc++.h>
using namespace std;
int 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);
    int pos = 0, need = 0, res = 0;
    for (int i = 30; i >= 0; i--)
      if ((1 << i) & x) {
        need++;
        int have = mapa[i];
        if (have >= need) {
          res += need;
          need = 0;
        } else {
          need -= have;
          need *= 2;
        }
      }
    if (need > 0)
      printf("-1\n");
    else
      printf("%d\n", res);
  }
  return 0;
}
