#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  int i, temp;
  cin >> n >> q;
  int a[n + 1];
  int b[40] = {0};
  int count;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    temp = a[i];
    count = 0;
    while (temp != 0) {
      temp /= 2;
      count++;
    }
    b[count - 1]++;
  }
  int x;
  while (q--) {
    cin >> x;
    count = 0;
    for (i = 30; i >= 0; i--) {
      temp = min(x >> i, b[i]);
      x -= temp * pow(2, i);
      count += temp;
      if (x == 0) break;
    }
    if (x == 0)
      cout << count;
    else
      cout << -1;
    cout << endl;
  }
}
