#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, int> two;
  map<int, long long> m_two;
  long long t = 1;
  for (int i = 0; i < 32; i++) {
    two[t] = i;
    m_two[i] = t;
    t *= 2;
  }
  int ar[33];
  memset(ar, 0, sizeof(ar));
  int n, q;
  cin >> n >> q;
  while (n--) {
    long long x;
    cin >> x;
    ar[two[x]]++;
  }
  while (q--) {
    long long amount;
    cin >> amount;
    long long ans = 0;
    for (int i = 31; i >= 0; i--) {
      if (ar[i] == 0) {
        continue;
      }
      long long m = m_two[i];
      long long d = amount / m;
      amount = amount % m;
      if (d <= ar[i]) {
        ans += d;
      } else {
        ans += ar[i];
        amount += (m * (d - ar[i]));
      }
      if (amount == 0) {
        break;
      }
    }
    if (amount == 0) {
      cout << ans << endl;
    } else {
      cout << "-1" << endl;
    }
  }
}
