#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
map<long long, long long> mp2;
map<long long, long long> mp3;
long long countSetBits(long long n) {
  if (n == 0)
    return 0;
  else
    return 1 + countSetBits(n & (n - 1));
}
int main() {
  long long i, j, k, l, m, n, q, cnt;
  cin >> n >> q;
  long long a[n + 10];
  for (i = 0; i < n; i++) cin >> a[i], mp[a[i]]++;
  while (q--) {
    cin >> l;
    cnt = 0;
    bool ok = true;
    for (i = 30; i >= 0; i--) {
      if (l <= 0) break;
      k = min(mp[1 << i], l / (1 << i));
      l -= (k * (1 << i));
      cnt += k;
    }
    if (l) ok = false;
    if (ok)
      cout << cnt << endl;
    else
      cout << -1 << endl;
  }
}
