#include <bits/stdc++.h>
using namespace std;
long long minf(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
int diff(int a, int b) { return abs(a - b); }
long long mul(long long a, long long b) { return (a * b) % 998244353; }
long long gcdf(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcdf(y, x % y);
}
void solve() {
  int x, n, k, cnt;
  cin >> n >> k;
  vector<int> arr, powers(35, 0);
  bool flag;
  for (int i = 0; i <= n - 1; i += 1) {
    cin >> x;
    powers[log2(x)]++;
  }
  while (k--) {
    cin >> x;
    arr.clear();
    for (int i = 31; i >= 0; i--) {
      if (x & (1 << i)) {
        arr.push_back(i);
      }
    }
    vector<int> temp(powers);
    cnt = 0;
    for (int i = 0; i < arr.size(); i++) {
      flag = true;
      if (temp[arr[i]] == 0) {
        int m = 2;
        flag = false;
        for (int j = arr[i] - 1; j >= 0; j--) {
          if (temp[j] >= m) {
            temp[j] -= m;
            flag = true;
            break;
          } else
            m -= temp[j], temp[j] = 0, m *= 2;
        }
        if (flag == false) {
          cout << -1 << '\n';
          break;
        } else
          cnt += m;
      } else
        cnt++, temp[arr[i]]--;
    }
    if (flag) cout << cnt << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
