#include <bits/stdc++.h>
#pragma optimization_level 3
using namespace std;
const long long mod = 1000000007;
const long long MAX = 222222;
const long long MAXD = 411111;
const long long INF = 1e18;
struct usual {
  long long x, y, z;
};
int main() {
  long long n, q;
  cin >> n >> q;
  vector<long long> v;
  map<long long, long long> mapa;
  for (int i = 0; i < n; i++) {
    long long aa;
    cin >> aa;
    v.push_back(aa);
    mapa[log2(aa)]++;
  }
  while (q--) {
    long long ss;
    cin >> ss;
    long long cnt = 0;
    for (int i = 32; i >= 0; i--) {
      if (pow(2, i) <= ss && mapa[i] > 0) {
        long long cnt1 = ss / (long long)pow(2, i);
        ss -= cnt1 * pow(2, i);
        cnt += cnt1;
      }
    }
    if (ss == 0)
      cout << cnt << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
