#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tt = 1;
  while (tt--) {
    int n, q;
    cin >> n >> q;
    int a[33] = {0};
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      a[int(log2(x))]++;
    }
    while (q--) {
      int x;
      cin >> x;
      int ans = 0;
      vector<int> cnt(33, 0);
      bool ok = 1;
      for (int i = 32; i >= 0; i--) {
        bool done = 0;
        if (x & (1 << i)) {
          if (a[i] - cnt[i] > 0) {
            cnt[i]++;
            ans++;
            continue;
          } else {
            if (i == 0) {
              ok = 0;
              break;
            }
            int sum = 0;
            int xc = x;
            for (int j = i - 1; j >= 0; j--) {
              int req = min(xc / (1 << j), a[j] - cnt[j]);
              xc -= (req * (1 << j));
              if (xc <= 0) break;
              ans += req;
              cnt[j] += req;
            }
            if (sum >= x) done = 1;
          }
          if (!done) ok = false;
          break;
        }
      }
      if (!ok)
        cout << -1 << endl;
      else
        cout << ans << endl;
    }
  }
}
