#include <bits/stdc++.h>
using namespace std;
int mark[40];
int32_t main() {
  int n, q;
  cin >> n >> q;
  while (n--) {
    int x;
    scanf("%d", &x), mark[__builtin_ctz(x)]++;
  }
  while (q--) {
    int p, ans = 0;
    scanf("%d", &p);
    for (int j = 30; ~j; j--) {
      int q = min(mark[j], p / (int)(1 << j));
      p -= q * (int)(1 << j), ans += q;
    }
    printf("%d\n", p ? -1 : ans);
  }
  return 0;
}
