#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int mp[50];
int power[50];
int po(long long x) {
  int ret = 0;
  long long bla = x;
  while (x > 1) {
    ret++;
    x /= 2;
  }
  power[ret] = bla;
  return ret;
}
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    int zz = po(a);
    if (!mp[zz]) v.push_back(zz);
    mp[zz]++;
  }
  sort(v.begin(), v.end());
  while (q--) {
    long long b;
    cin >> b;
    int ans = 0;
    for (int i = v.size() - 1; i >= 0; i--) {
      if (b / power[v[i]] > 0) {
        int x = min((long long)mp[v[i]], (b / power[v[i]]));
        b -= x * power[v[i]];
        ans += x;
      }
    }
    if (b) ans = -1;
    cout << ans << endl;
  }
}
