#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 3;
unordered_map<long long, long long> mapa, mapa2;
long long ans = 0;
bool isOk(long long bit, long long cant) {
  if (!bit) return 0;
  if (mapa[bit] >= cant) {
    mapa[bit] -= cant;
    ans += cant;
    return 1;
  }
  ans += mapa[bit];
  cant -= mapa[bit];
  return isOk(bit / 2, cant * 2);
}
long long a[MAXN];
pair<long long, long long> b[MAXN];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = (int)0; i < (int)n; i++) {
    scanf("%lld", &a[i]);
    mapa[a[i]]++;
  }
  int cant = 0;
  for (int i = (int)0; i < (int)n; i++) {
    if (!mapa2[a[i]]) {
      b[cant++] = {a[i], mapa[a[i]]};
      mapa2[a[i]] = 1;
    }
  }
  for (int i = (int)0; i < (int)q; i++) {
    long long nt;
    scanf("%lld", &nt);
    long long cnt = 0, good = 1;
    for (int i = (int)33; i > (int)-1; i--) {
      if (nt & (1ll << i)) {
        ans = 0;
        int ct = isOk(1ll << i, 1);
        if (ct) {
          cnt += ans;
        } else {
          good = 0;
          break;
        }
      }
    }
    if (good)
      printf("%lld\n", cnt);
    else
      printf("-1\n");
    for (int i = (int)0; i < (int)cant; i++) mapa[b[i].first] = b[i].second;
  }
}
