#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  vector<int> bits(32, 0);
  for (int i = 1; i <= n; i++) {
    int val, cnt = 0;
    cin >> val;
    while (val > 1) {
      cnt++;
      val = val >> 1;
    }
    bits[cnt]++;
  }
  for (int i = 1; i <= q; i++) {
    int sum, cnt = 0, j = 31;
    cin >> sum;
    vector<int> temp = bits;
    while ((sum != 0) && (j >= 0)) {
      int req = sum / (1 << j);
      if (temp[j] >= req) {
        sum -= req * (1 << j);
        cnt += req;
      } else {
        sum -= temp[j] * (1 << j);
        cnt += temp[j];
      }
      j--;
    }
    if (sum != 0)
      cout << -1 << "\n";
    else
      cout << cnt << "\n";
  }
  return 0;
}
