#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  int a[n];
  int ans[31] = {0};
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ans[__builtin_ctz(x)]++;
  }
  for (int i = 0; i < q; i++) {
    int x, sum = 0;
    cin >> x;
    for (int i = 30; i >= 0 && x > 0; i--) {
      int need = min(ans[i], x >> i);
      sum += need;
      x -= (1 << i) * need;
    }
    if (x > 0)
      cout << -1 << "\n";
    else {
      cout << sum << "\n";
    }
  }
  return 0;
}
