#include <bits/stdc++.h>
using namespace std;
int n, q;
map<int, int> ma;
int main(void) {
  freopen("testin.txt", "r", stdin);
  int x;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    ma[x]++;
  }
  while (q--) {
    cin >> x;
    int ans = 0;
    for (int i = (1 << 30); i >= 1; i = i / 2) {
      int temp = min(ma[i], x / i);
      ans += temp;
      x -= temp * i;
    }
    if (x) {
      ans = -1;
    }
    cout << ans << endl;
  }
  return 0;
}
