#include <bits/stdc++.h>
using namespace std;
const int tinf = (int)1e9 + 7;
const long long inf = (long long)1e18 + 7;
const int N = 4e5 + 5;
long long gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
bool cmp(long long a, long long b) { return a > b; }
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
  }
  long long n, q, b[N], a[N];
  map<long long, long long> g;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    g[a[i]]++;
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < q; i++) {
    cin >> b[i];
    long long z = b[i], ans = 0, t = 1073741824;
    for (int i = 30; i >= 0; i--) {
      if (g[t] > 0) ans += min(z / t, g[t]), z -= min(z / t, g[t]) * t;
      t /= 2;
    }
    if (!z)
      cout << ans << endl;
    else
      cout << -1 << endl;
  }
}
