#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int dem[32], a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    for (int j = 0; j < 32; ++j) {
      if ((a[i] & (1 << j)) == (1 << j)) dem[j]++;
    }
  }
  while (q--) {
    int val;
    cin >> val;
    priority_queue<pair<int, int> > q;
    for (int i = 0; i < 32; ++i) {
      q.push(pair<int, int>(i, dem[i]));
    }
    bool kt = 0;
    int ans = 0, temp = 0;
    for (int i = 32; i >= 0; --i) {
      if ((val & (1 << i)) == (1 << i)) {
        int tmp = (1 << i);
        while (!q.empty() && tmp) {
          int bit = q.top().first;
          int cur_dem = q.top().second;
          if (bit > i || cur_dem == 0)
            q.pop();
          else {
            int cur_use = tmp / (1 << bit);
            if (cur_use >= cur_dem) {
              tmp -= (1 << bit) * cur_dem;
              ans += cur_dem;
              q.pop();
            } else {
              cur_dem -= cur_use;
              ans += cur_use;
              tmp = 0;
              q.pop();
              q.push(pair<int, int>(bit, cur_dem));
            }
          }
        }
        if (tmp) {
          kt = 1;
          break;
        }
      }
    }
    if (!kt)
      cout << ans << '\n';
    else
      cout << "-1\n";
  }
}
