#include <bits/stdc++.h>
using namespace std;
long long int cnt[50];
int main() {
  long long int n, q;
  cin >> n >> q;
  for (long long int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    x = log2(x);
    cnt[x]++;
  }
  for (long long int i = 1; i <= q; i++) {
    long long int x;
    cin >> x;
    long long int res = 0;
    for (long long int i = 31; i >= 0; i--) {
      long long int esq = 0, dir = cnt[i], aux = 0;
      while (esq <= dir) {
        long long int mid = (esq + dir) / 2;
        if (x >= (1 << i) * mid) {
          aux = max(aux, mid);
          esq = mid + 1;
        } else
          dir = mid - 1;
      }
      x -= (1 << i) * aux;
      res += aux;
    }
    if (x == 0)
      cout << res << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
