#include <bits/stdc++.h>
using namespace std;
long long md = 1000000007;
long long bexp(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long r = bexp(a, b / 2);
  r = r * r;
  if (b % 2 == 0)
    return r;
  else
    return r * a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test_case = 1;
  while (test_case--) {
    long long i, j, n, m, q, k;
    cin >> n >> q;
    vector<long long> v(35, 0);
    for (i = 0; i < n; i++) {
      cin >> k;
      long long p = log2(k);
      v[p]++;
    }
    vector<long long> v1 = v;
    while (q--) {
      cin >> k;
      long long flag = 0, ans = 0;
      v = v1;
      for (i = 32; i >= 0; i--) {
        if (k == 0) {
          flag = 1;
          break;
        }
        long long p = bexp(2, i);
        while (k > 0 && v[i] > 0 && k >= p) {
          long long l = k / p;
          long long z = min(l, v[i]);
          ans += z;
          k = k - p * z;
          v[i] = v[i] - z;
        }
      }
      if (k == 0) {
        flag = 1;
      }
      if (flag == 1) {
        cout << ans << "\n";
      } else {
        cout << "-1\n";
      }
    }
  }
  return 0;
}
