#include <bits/stdc++.h>
using namespace std;
map<long long, long long> hm;
void setall(long long a[], long long l, long long r, long long sum = 0,
            long long cnt = 0) {
  if (l > r) {
    hm[sum] = cnt;
    return;
  }
  setall(a, l + 1, r, sum + a[l], cnt + 1);
  setall(a, l + 1, r, sum, cnt);
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed;
  cout << setprecision(12);
  long long n, q;
  cin >> n >> q;
  long long a[n];
  map<long long, long long> main;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    main[a[i]]++;
  }
  for (long long z = 0; z < q; z++) {
    long long x;
    cin >> x;
    if (x % 2 == 1 && main[1] == 0) {
      cout << -1 << endl;
      continue;
    }
    long long lsp = 0, val = 1, cnt = 0;
    while (val <= x) {
      val = 2 * val;
      lsp++;
    }
    val = val / 2;
    lsp--;
    while (x > 0 && lsp >= 0) {
      long long tmp = min(main[val], x / val);
      cnt += tmp;
      x = x - tmp * val;
      val /= 2;
      lsp--;
    }
    if (x == 0)
      cout << cnt << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
