#include <bits/stdc++.h>
using namespace std;
long long maxi = LLONG_MIN;
long long mini = LLONG_MAX;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
long long t, i, j, k, n, temp, flag, ans, m;
int main() {
  long long n, q;
  cin >> n >> q;
  vector<long long> a(n);
  vector<long long> b(40);
  vector<long long> m(40, 0);
  vector<long long> tm(40, 0);
  for (i = 0; i <= 32; i++) {
    b[i] = pow(2, i);
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
    for (j = 0; j <= 32; j++) {
      if (a[i] == b[j]) {
        tm[j]++;
        break;
      }
    }
  }
  while (q--) {
    long long x;
    cin >> x;
    m = tm;
    long long ans = 0;
    for (i = 32; i >= 0; i--) {
      if (m[i] == 0 || x < b[i]) continue;
      long long maxsub = min(x / b[i], m[i]);
      m[i] -= maxsub;
      x -= maxsub * b[i];
      ans += maxsub;
    }
    if (x != 0) {
      cout << -1 << '\n';
    } else {
      cout << ans << '\n';
    }
  }
  return 0;
}
