#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[20] = {0};
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    int p;
    cin >> p;
    int m = round(log(p) / log(2));
    a[m] += 1;
  }
  while (q--) {
    int p;
    cin >> p;
    int l = log(p) / log(2);
    int cnt = 0;
    for (int i = l; i >= 0; i--) {
      if (pow(2.0, i) > p) continue;
      if (a[i] > 0) {
        cnt += (min((int)(p / pow(2.0, i)), a[i]));
        p -= (pow(2.0, i)) * (int)(min((int)(p / pow(2.0, i)), a[i]));
      }
      if (p == 0) {
        break;
      }
    }
    if (p > 0) {
      cout << "-1" << endl;
      ;
    } else {
      cout << cnt << endl;
    }
  }
  return 0;
}
