#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int n, q;
  cin >> n >> q;
  int arr[31] = {0};
  int num;
  for (int i = 0; i < n; i++) {
    cin >> num;
    ++arr[__builtin_ctz(num)];
  }
  while (q--) {
    cin >> num;
    int cnt = 0;
    int tmpcnt = 0;
    for (int i = 30; i >= 0 && num > 0; i--) {
      tmpcnt = min(num >> i, arr[i]);
      cnt += tmpcnt;
      num -= (1 << i) * tmpcnt;
    }
    if (num > 0)
      cout << "-1" << endl;
    else
      cout << cnt << endl;
  }
  return 0;
}
