#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, q;
  cin >> n >> q;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    m[x]++;
  }
  while (q--) {
    long long x;
    cin >> x;
    long long count = 0;
    long long coins = 0;
    for (long long i = 20; i >= 0; i--) {
      if ((x & (1 << i)) != 0 || count != 0) {
        if ((x & (1 << i)) != 0) count = count + 1;
        long long val = (1 << i);
        if (m[val] != 0) {
          if (m[val] >= count) {
            coins += count;
            count = 0;
          } else {
            count = count - m[val];
            coins += m[val];
          }
        }
        count = count * 2;
      }
    }
    if (count != 0)
      cout << -1 << endl;
    else
      cout << coins << endl;
  }
  return 0;
}
