#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, q;
int sum[35];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    int t = log2(x);
    sum[t]++;
  }
  while (q--) {
    int x, ans = 0;
    scanf("%d", &x);
    for (int i = 31; i >= 0; i--) {
      int cur = min(sum[i], x / (1 << i));
      ans += cur;
      x -= (1 << i) * cur;
    }
    if (x != 0)
      puts("-1");
    else
      cout << ans << endl;
  }
  return 0;
}
