#include <bits/stdc++.h>
using namespace std;
const long long N = 100001;
const long long MOD = 1000000007;
const long long INF = LLONG_MAX;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int tc = 1, cs = 0;
  while (tc--) {
    int n, q, x, i, ans;
    cin >> n >> q;
    vector<int> cnt(31);
    for (i = 0; i < n; i++) {
      cin >> x;
      ++cnt[__builtin_ctz(x)];
    }
    while (q--) {
      cin >> x;
      ans = 0;
      for (i = 30; i >= 0; i--) {
        int need = min((x >> i), cnt[i]);
        ans += need;
        x -= (1 << i) * need;
      }
      if (x) ans = -1;
      cout << ans << '\n';
    }
  }
}
