#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, -1, 0, 0}, dy[4] = {0, 0, 1, -1};
int main() {
  int i, j, y, t;
  long long int pow2[40], x;
  pow2[0] = 1LL;
  for (i = 1; i <= 35; ++i) pow2[i] = 2LL * pow2[i - 1];
  int n, q;
  cin >> n >> q;
  long long int a[40] = {0}, b[40] = {0};
  for (i = 1; i <= n; ++i) {
    cin >> x;
    int c = 0;
    while (x > 1) {
      ++c;
      x /= 2LL;
    }
    a[c]++;
    b[c]++;
  }
  while (q--) {
    cin >> x;
    int c = 0;
    for (i = 33; i >= 0; --i) {
      if (pow2[i] <= x && b[i]) {
        long long int d = (long long int)x / pow2[i];
        long long int e = min(b[i], d);
        c += e;
        x -= e * pow2[i];
      }
    }
    if (x == 0)
      cout << c << "\n";
    else
      cout << "-1\n";
  }
  return 0;
}
