#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, q, x, cont = 0, total = 0;
  cin >> n >> q;
  vector<long long int> V(n);
  vector<long long int> F(65, -1);
  for (int i = 0; i < n; i++) {
    cin >> x;
    V[i] = x;
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < n - 1; i++) {
    if (V[i] != V[i + 1]) {
      int num = log2(V[i]);
      F[num] = cont + 1;
      cont = 0;
    } else
      cont++;
  }
  int numm = log2(V[n - 1]);
  F[numm] = cont + 1;
  for (int i = 0; i < q; i++) {
    cin >> x;
    total = 0;
    int value = log2(x);
    for (int j = value; j >= 0 and x != 0; j--) {
      if (F[j] != -1) {
        long long int number = pow(2, j);
        int division = x / number;
        if (division <= F[j]) {
          x -= number * division;
          total += division;
        } else {
          x -= number * F[j];
          total += F[j];
        }
      }
    }
    if (x != 0)
      cout << "-1" << endl;
    else
      cout << total << endl;
  }
}
