#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  int a[33] = {0};
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    x = round(log2(x));
    a[x]++;
  }
  for (int i = 0; i < q; i++) {
    int ans = 0, val;
    cin >> val;
    for (int j = 31; j >= 0; j--) {
      if (a[j]) {
        int div = val / (1 << j);
        int need = min(div, a[j]);
        ans += need;
        val -= (need * (1 << j));
        if (val == 0) break;
      }
    }
    if (val == 0)
      cout << ans << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
