#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
const int inf = 1e9 + 7;
const double eps = 1e-6;
long long a[105], n, q, t[105], ans;
bool check(int i) {
  int cnt = 1;
  for (int j = i; j >= 0; --j) {
    if (a[j] >= cnt) {
      a[j] -= cnt;
      ans += cnt;
      return true;
    } else {
      cnt -= a[j];
      a[j] = 0;
      ans += a[j];
      cnt *= 2;
    }
  }
  return false;
}
bool solve(long long x) {
  for (int i = 60; i >= 0; --i) {
    if (((long long)1 << i) & x) {
      if (!check(i)) return false;
    }
  }
  return true;
}
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    int cnt = 0;
    while (x) {
      x >>= 1;
      cnt++;
    }
    a[cnt - 1]++;
  }
  memcpy(t, a, sizeof(a));
  while (q--) {
    memcpy(a, t, sizeof(a));
    long long b;
    cin >> b;
    ans = 0;
    if (!solve(b))
      cout << -1 << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
