#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, a, t;
  cin >> n >> t;
  vector<long long> mp(32);
  for (long long i = 0; i < n; i++) {
    cin >> a;
    long long x = 0;
    while (a != 1) {
      a /= 2;
      x++;
    }
    mp[x]++;
  }
  while (t--) {
    long long b;
    cin >> b;
    vector<long long> v;
    while (b != 1) {
      v.push_back(b % 2);
      b /= 2;
    }
    v.push_back(1);
    long long res = 0, flag = 0;
    for (long long i = v.size() - 1; i > -1; i--) {
      if (v[i] > 0) {
        if (i > 0) {
          res += min(mp[i], v[i]);
          v[i - 1] += (v[i] - min(mp[i], v[i])) * 2;
        } else {
          if (mp[i] < v[i])
            flag = 1;
          else
            res += min(mp[i], v[i]);
        }
      }
    }
    if (flag == 1)
      cout << -1 << endl;
    else
      cout << res << endl;
  }
  return 0;
}
