#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double pi = acos(-1);
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int N = 55;
vector<long long> adj[55];
int main() {
  int n, q;
  cin >> n >> q;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    int indx = (int)log2(a[i]);
    adj[indx].push_back(a[i]);
  }
  for (int i = 0; i < N; ++i)
    if (!adj[i].empty())
      partial_sum((adj[i]).begin(), (adj[i]).end(), adj[i].begin());
  int num;
  while (q--) {
    cin >> num;
    int cnt = 0;
    for (int i = N - 1; ~i; --i) {
      if (!adj[i].empty()) {
        auto it = upper_bound((adj[i]).begin(), (adj[i]).end(), num);
        int indx = it - adj[i].begin();
        cnt += indx;
        if (indx) num -= *(--it);
      }
    }
    if (num)
      puts("-1");
    else
      cout << cnt << endl;
  }
}
