#include <bits/stdc++.h>
long long int ar[64];
long long int ar1[200005];
int main() {
  long long int n, q, i;
  scanf("%lld%lld", &n, &q);
  for (i = 0; i <= 35; i++) ar[i] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%lld", &ar1[i]);
    ar[(long long int)log2(ar1[i])]++;
  }
  long long int temp;
  long long int flag = 0;
  long long int cnt = 0;
  long long int ans = 0;
  while (q--) {
    flag = 0;
    cnt = 0;
    ans = 0;
    scanf("%lld", &temp);
    for (i = 35; i >= 0; i--) {
      if ((temp & (1 << i)) >> i == 1) {
        cnt++;
      }
      if (cnt <= ar[i]) {
        ans += (cnt);
        cnt = 0;
      } else {
        ans += (ar[i]);
        cnt -= ar[i];
        cnt += cnt;
      }
    }
    if (cnt != 0)
      printf("-1\n");
    else
      printf("%lld\n", ans);
  }
  return 0;
}
