#include <bits/stdc++.h>
using namespace std;
int n, q, coins[32];
int main() {
  cin >> n >> q;
  int tmp;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    coins[static_cast<int>(log(tmp) / log(2))]++;
  }
  int ans = 0, cur = 0;
  for (int i = 0; i < q; i++) {
    int val;
    cin >> val;
    ans = 0;
    cur = 0;
    for (int j = 31; j >= 0; j--) {
      if (val & (1 << j)) cur += (1 << j);
      if (coins[j]) {
        int amt = min(coins[j], cur / (1 << j));
        ans += amt;
        cur -= (1 << j) * amt;
      }
    }
    if (cur > 0)
      cout << "-1\n";
    else
      cout << ans << endl;
  }
}
