#include <bits/stdc++.h>
using namespace std;
const int xx = 2 * 1e5 + 10;
int n, q;
int a[200010];
int cnt[66];
int solve(int q) {
  int ans = 0;
  for (int i = 30; i >= 0 && q > 0; i--) {
    int t = (1 << i);
    if (!(q & t)) continue;
    for (int j = i; j >= 0; j--) {
      if (t < (1 << j)) continue;
      if (!t) break;
      int t2 = (1 << j) * cnt[j];
      if (t >= t2) {
        t -= t2;
        ans += cnt[j];
      } else {
        int t3 = t / (1 << j);
        t3 = min(t3, cnt[j]);
        ans += t3;
        t -= t3 * (1 << j);
      }
    }
  }
  return ans;
}
int main() {
  scanf("%d %d", &n, &q);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
    int id = log2(a[i]);
    cnt[id]++;
  }
  while (q--) {
    int b;
    scanf("%d", &b);
    int ans;
    if (sum < b)
      ans = -1;
    else if (b % 2 && !cnt[0])
      ans = -1;
    else
      ans = solve(b);
    printf("%d\n", ans);
  }
}
