#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int bit[50] = {0};
  long long int n, q;
  cin >> n >> q;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    bit[(long long int)log2(x)] += 1;
  }
  for (long long int i = 0; i < q; i++) {
    long long int x;
    cin >> x;
    long long int bin[50];
    long long int temp[50];
    for (long long int i = 0; i < 50; i++) {
      temp[i] = bit[i];
      bin[i] = x & 1;
      x /= 2;
    }
    long long int ans = 0;
    bool f = true;
    for (long long int i = 49; i >= 0; i--) {
      if (bin[i] != 0) {
        long long int t = min(temp[i], bin[i]);
        bin[i] -= t;
        temp[i] -= t;
        ans += t;
        if (i >= 1)
          bin[i - 1] += 2 * bin[i];
        else if (bin[i] != 0) {
          f = false;
        }
        bin[i] = 0;
      }
    }
    if (f)
      cout << ans;
    else
      cout << -1;
    cout << "\n";
  }
  return 0;
}
