#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 7;
int N, M, x, y;
const int INF = 0x3f3f3f3f;
long long a[MAX], b[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (cin >> N >> M) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < N; i++) {
      int x;
      cin >> x;
      a[(int)log2(x)]++;
    }
    for (int i = 0; i < 5; i++) {
    }
    while (M--) {
      long long q;
      cin >> q;
      int ans = 0;
      for (int i = 31; i >= 0; i--) {
        if (a[i]) {
          long long tmp = 1 << i;
          long long ret = q / tmp;
          ret = min(ret, a[i]);
          ans += ret;
          q -= ret * tmp;
        }
      }
      if (q)
        cout << -1 << endl;
      else
        cout << ans << endl;
    }
  }
  return 0;
}
