#include <bits/stdc++.h>
using namespace std;
vector<long long> used(32, 0);
vector<long long> used1(32, 0);
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    long long c;
    cin >> c;
    const long long d = log2(c);
    used1[d]++;
  }
  for (long long i = 0; i < m; i++) {
    long long k;
    cin >> k;
    used = used1;
    bool check = 1;
    long long ans = 0;
    for (long long j = 30; j >= 0; j--) {
      if (k & (1 << j)) {
        long long sum = 0;
        for (long long p = 0; p <= j; p++) {
          sum += (1 << p) * used[p];
        }
        if (sum < (1 << j)) {
          check = 0;
          break;
        }
        long long now = (1 << j);
        long long l = 0;
        for (long long p = j; p >= 0; p--) {
          used[p] -= (now / (1 << j));
          ans += (now / ((1 << j)));
          now %= (1 << j);
        }
        k -= pow(2, j);
      }
    }
    if (check) {
      cout << ans;
    } else {
      cout << -1;
    }
    cout << endl;
  }
}
