#include <bits/stdc++.h>
int faster_in() {
  int r = 0, c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') return -faster_in();
  for (; c > 32; r = (r << 1) + (r << 3) + c - '0', c = getchar())
    ;
  return r;
}
using namespace std;
const int INF = int(1e9 + 7);
long long v[35], a[35];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    v[(int)log2(x)]++;
  }
  while (q--) {
    for (int i = 0; i < 35; i++) a[i] = v[i];
    long long b;
    cin >> b;
    long long res = 0;
    for (int i = 34; b > 0 && i >= 0; i--) {
      if ((b & (1LL << i)) == 0) continue;
      long long needed = 1;
      for (int j = i; j >= 0; j--) {
        if (a[j] >= needed) {
          b -= (1LL << i);
          res += needed;
          a[j] -= needed;
          break;
        }
        needed *= 2LL;
      }
    }
    if (b)
      cout << -1 << '\n';
    else
      cout << res << '\n';
  }
  return 0;
}
