Polycarp has n coins, the value of the i-th coin is a_i. It is guaranteed that all the values are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).

Polycarp wants to know answers on q queries. The j-th query is described as integer number b_j. The answer to the query is the minimum number of coins that is necessary to obtain the value b_j using some subset of coins (Polycarp can use only coins he has). If Polycarp can't obtain the value b_j, the answer to the j-th query is -1.

The queries are independent (the answer on the query doesn't affect Polycarp's coins).

Input

The first line of the input contains two integers n and q (1 ≤ n, q ≤ 2 ⋅ 10^5) — the number of coins and the number of queries.

The second line of the input contains n integers a_1, a_2, ..., a_n — values of coins (1 ≤ a_i ≤ 2 ⋅ 10^9). It is guaranteed that all a_i are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).

The next q lines contain one integer each. The j-th line contains one integer b_j — the value of the j-th query (1 ≤ b_j ≤ 10^9).

Output

Print q integers ans_j. The j-th integer must be equal to the answer on the j-th query. If Polycarp can't obtain the value b_j the answer to the j-th query is -1.

Example

Input

5 4
2 4 8 2 4
8
5
14
10


Output

1
-1
3
2
#include <bits/stdc++.h>
using namespace std;
static const int _ = []() {
  ios::sync_with_stdio(false);
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  return 0;
}();
template <class T>
inline vector<T> rv(long long n) {
  vector<T> v(n);
  for (long long i = 0; i < (n); i++) cin >> v[i];
  return v;
}
template <class T>
inline void pv(const vector<T>& v) {
  for (long long i = 0; i < (v.size()); i++) cout << v[i] << " ";
  cout << endl;
}
template <class T>
inline void amax(T& a, const T& b) {
  if (a < b) a = b;
}
template <class T>
inline void amin(T& a, const T& b) {
  if (a > b) a = b;
}
const long long MOD = 1e9 + 7;
const long long MOD1 = 998244353;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
struct Rd {
  template <typename T>
  Rd& operator>>(T& n) {
    cin >> n;
    return *this;
  }
  template <typename T>
  Rd& operator>>(vector<T>& v) {
    for (long long i = 0; i < v.size(); i++) {
      cin >> v[i];
    }
    return *this;
  }
  template <typename T, typename U>
  Rd& operator>>(vector<pair<T, U>>& v) {
    for (long long i = 0; i < v.size(); i++) {
      cin >> v[i].first >> v[i].second;
    }
    return *this;
  }
  template <typename T>
  Rd& operator>>(vector<vector<T>>& v) {
    for (long long i = 0; i < v.size(); i++) {
      for (long long j = 0; j < v[i].size(); j++) {
        cin >> v[i][j];
      }
    }
    return *this;
  }
} rd;
vector<long long> p2() {
  long long x = 1;
  vector<long long> v;
  while (x < (1LL << 62)) {
    v.push_back(x);
    x *= 2;
  }
  return v;
}
long long lg2(long long n) {
  long long x = 0;
  n >>= 1;
  while (n) {
    x++;
    n >>= 1;
  }
  return x;
}
int main(int argc, char** argv) {
  long long n, q;
  rd >> n >> q;
  vector<long long> a(n), b(q);
  rd >> a >> b;
  vector<long long> c(63, 0);
  vector<long long> p = p2();
  for (long long i = 0; i < (a.size()); i++) {
    c[lg2(a[i])]++;
  }
  for (long long j = 0; j < (q); j++) {
    vector<long long> t(c);
    bool found = true;
    long long coins = 0;
    for (long long i = 61; i >= 0 && b[j] > 0; i--) {
      long long needed = min(t[i], b[j] / p[i]);
      coins += needed;
      b[j] -= needed * p[i];
    }
    cout << (b[j] ? -1LL : coins) << endl;
  }
  return 0;
}
