#include <bits/stdc++.h>
using namespace std;
int A[40], X[40];
int main() {
  int i, n, t, a, b, ans;
  cin >> n >> t;
  X[0] = 1;
  for (i = 1; i <= 30; i++) {
    X[i] = X[i - 1] * 2;
  }
  while (n-- > 0) {
    cin >> a;
    for (i = 0; i <= 30; i++) {
      if (X[i] == a) {
        A[i]++;
        break;
      }
    }
  }
  while (t-- > 0) {
    cin >> a;
    ans = 0;
    for (i = 30; i >= 0; i--) {
      if (!A[i] || X[i] > a) continue;
      b = min(A[i], a / X[i]);
      ans += b;
      a -= X[i] * b;
      if (a == 0) break;
    }
    if (a)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
}
