#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  while (t--) {
    long long int i, j, k, m, n, x, q;
    cin >> n >> q;
    map<long long int, long long int> mp;
    long long int bc[33];
    for (int i = 0; i < 33; i++) bc[i] = 0;
    for (int i = 0; i < n; i++) {
      cin >> j;
      mp[j]++;
      k = log2(j);
      bc[k]++;
    }
    while (q--) {
      cin >> x;
      long long int ans = 0;
      for (i = 32; i >= 0; i--) {
        if (x >= (1LL << i)) {
          long long int cn = x / (1 << i);
          if (bc[i] >= cn) {
            ans += cn;
            x -= ((1LL << i) * cn);
          } else {
            ans += bc[i];
            x -= ((1LL << i) * bc[i]);
          }
        }
      }
      if (x == 0)
        cout << ans << "\n";
      else
        cout << -1 << "\n";
    }
  }
  return 0;
}
