#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (mp.count(a) == 0)
      mp[a] = 1;
    else
      mp[a]++;
  }
  while (q--) {
    int ans = 0, time;
    int b;
    cin >> b;
    for (int i = 1 << 30; i >= 1; i /= 2) {
      time = min(mp[i], b / i);
      ans += time;
      b -= time * i;
    }
    if (b)
      cout << "-1" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
