#include <bits/stdc++.h>
using namespace std;
long long int cnt[100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, q;
  long long int a;
  for (int i = 0; i <= 99; i++) cnt[i] = 0;
  cin >> n >> q;
  for (long long int i = 0; i < n; i++) {
    cin >> a;
    long long int lk = log2(a);
    cnt[lk]++;
  }
  for (long long int j = 0; j < q; j++) {
    cin >> a;
    long long int num = 0;
    for (int i = 99; i >= 0; i--) {
      if (cnt[i] > 0) {
        long long int val = pow(2, i);
        long long int k = min(a / val, cnt[i]);
        a -= (val * k);
        num += k;
      }
    }
    if (!a)
      cout << num << "\n";
    else
      cout << -1 << "\n";
  }
}
