#include <bits/stdc++.h>
using namespace std;
string dtob(long long int n) {
  string r = "";
  long long int t = n;
  while (n > 0) {
    r = to_string(n % 2) + r;
    n /= 2;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, q;
  cin >> n >> q;
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    m[x] += 1;
  }
  for (long long int i = 0; i < q; i++) {
    long long int x;
    cin >> x;
    string s = dtob(x);
    long long int res = 0;
    map<long long int, long long int> m1 = m;
    long long int p = 1, f = 1;
    for (long long int i = s.length() - 1; i > -1 and f == 1; i--) {
      long long int t = s[i] - '0';
      if (t == 1) {
        long long int v = p, key = v;
        while (v > 0 and key > 0) {
          if (m1[key] * key >= v) {
            long long int needed = v / key;
            m1[key] -= needed;
            res += needed;
            v = 0;
            break;
          } else {
            res += m1[key];
            m1[key] = 0;
            v -= m1[key] * key;
            key = key / 2;
          }
        }
        if (v > 0) f = 0;
      }
      p *= 2;
    }
    if (f == 0)
      cout << "-1" << endl;
    else
      cout << res << endl;
  }
}
