#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200 * 1000;
int coin[MAX_N + 10];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    coin[(int)log2(a)]++;
  }
  for (int i = 0; i < q; i++) {
    int b, ans = 0;
    cin >> b;
    for (int i = 35; i >= 0; i--) {
      int temp = 1 << i;
      ans += min(b / temp, coin[i]);
      b -= min(b / temp, coin[i]) * temp;
    }
    if (b)
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
}
