#include <bits/stdc++.h>
using namespace std;
static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
void sieve() {
  int spf[1000003];
  spf[1] = 1;
  for (int i = 2; i < 1000003; i++) spf[i] = i;
  for (int i = 4; i < 1000003; i += 2) spf[i] = 2;
  for (int i = 3; i * i < 1000003; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j < 1000003; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
long long power[32];
void poss(int bj, vector<long long int> &coins) {
  long long req;
  long long ans = 0;
  int logval = (int)log2(bj);
  while (bj > 0) {
    if (logval == -1) {
      ans = -1;
      break;
    }
    req = bj / power[logval];
    int idx = req;
    if (coins[logval] == 0) {
      logval--;
      continue;
    }
    int _min = min(coins[logval], req);
    ans += _min;
    bj -= (_min * power[logval]);
    logval--;
  }
  cout << ans << endl;
}
void solve2() {
  for (int(i) = 0; (i) < (int)(32); ++(i)) {
    if (!i)
      power[i] = 1;
    else
      power[i] = 2 * power[i - 1];
  }
  long long n, q;
  cin >> n >> q;
  vector<long long int> a(n);
  vector<long long int> coins(25, 0);
  for (int(i) = 0; (i) < (int)(n); ++(i)) {
    cin >> a[i];
    coins[log2(a[i])]++;
  }
  for (int(i) = 0; (i) < (int)(q); ++(i)) {
    long long bj;
    cin >> bj;
    poss(bj, coins);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  solve2();
  return 0;
}
