#include <bits/stdc++.h>
using namespace std;
long long solve(long long n) {
  long long cnt = 0;
  while (n % 2 == 0) {
    cnt++;
    n /= 2;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<long long> arr;
  vector<long long> freq(40, 0);
  long long p = 1;
  for (int i = 0; i < 40; i++) {
    arr.push_back(p);
    p *= 2;
  }
  long long n, q, x, num;
  long long sum = 0;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> x;
    sum += x;
    freq[solve(x)]++;
  }
  while (q--) {
    cin >> num;
    long long hi = 39;
    long long cnt = 0;
    while (hi >= 0) {
      if (arr[hi] > num) {
        hi--;
        continue;
      } else {
        long long p = num / arr[hi];
        if (p >= freq[hi]) {
          num -= (freq[hi] * arr[hi]);
          cnt += freq[hi];
        } else {
          num -= (p * arr[hi]);
          cnt += p;
        }
        hi--;
      }
    }
    if (num > 0)
      cout << -1;
    else
      cout << cnt;
    cout << "\n";
  }
}
