#include <bits/stdc++.h>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template <class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
  int n, q;
  cin >> n >> q;
  vector<int> cnt(32);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    cnt[__builtin_ffs(x) - 1]++;
  }
  for (int i = 0; i < q; ++i) {
    int val, ans = 0;
    scanf("%d", &val);
    for (int j = 30; j >= 0; --j) {
      int k = min(cnt[j], val >> j);
      val -= k * (1 << j);
      ans += k;
    }
    if (val)
      puts("-1");
    else
      printf("%d\n", ans);
  }
  return 0;
}
