#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q, ans = 0;
  long x, cur, ch;
  cin >> n >> q;
  vector<long> a(n);
  map<long, long> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  for (int i = 0; i < q; i++) {
    cin >> x;
    ans = 0;
    for (int i = 30; i >= 0; i--) {
      ch = pow(2, i);
      cur = min(b[ch], x / ch);
      x -= cur * ch;
      ans += cur;
    }
    if (x != 0)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
