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