#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, q;
long long vc, t[35], l[35], tmp, res;
void Ip() {
  cin >> n >> q;
  for (long long i = 1; i <= n; i++) {
    cin >> vc;
    long long v = log2(vc);
    t[v]++;
  }
}
void Solve() {
  while (q--) {
    res = 0;
    cin >> tmp;
    for (long long i = 1; i <= 34; i++) l[i] = t[i];
    long long g = log2(tmp);
    while (tmp > 0 && g >= 0) {
      long long hi = pow(2, g);
      while (l[g] > 0 && tmp >= hi) {
        res++;
        tmp -= hi;
        l[g]--;
      }
      g--;
    }
    if (tmp == 0)
      cout << res << "\n";
    else
      cout << "-1\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Ip();
  Solve();
  return 0;
}
