#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, c, x, j, n, q, ans;
  cin >> n >> q;
  long long a[35];
  a[0] = 0;
  for (i = 0; i < n; i++) {
    cin >> x;
    c = 0;
    while (x > 1) {
      x /= 2;
      c++;
    }
    a[c]++;
  }
  long long int tk = 0, coin = 0;
  for (i = 0; i < q; i++) {
    cin >> x;
    tk = coin = 0;
    for (j = 31; j > 0; j--) {
      tk = pow(2, j);
      if (x >= tk) {
        ans = x / tk;
        if (a[j] >= ans) {
          x -= (tk * ans);
          coin += ans;
        } else {
          x -= (tk * a[j]);
          coin += a[j];
        }
      }
    }
    if (x) coin = -1;
    cout << coin << endl;
  }
  return 0;
}
