#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6 + 9;
const long long int mod = 998244353;
map<long long int, long long int> mpp;
vector<long long int> v;
long long int a[N];
void solve() {
  long long int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    mpp[a[i]]++;
    if (mpp[a[i]] == 1) v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  while (q--) {
    long long int cnt = 0, y, x = v.size();
    cin >> y;
    for (int i = x - 1; i >= 0; --i) {
      if (y >= v[i]) {
        long long int p = y / v[i];
        if (p >= mpp[v[i]]) {
          y -= mpp[v[i]] * v[i];
          cnt += mpp[v[i]];
        } else {
          y -= (y / v[i]) * v[i];
          cnt += p;
        }
      }
    }
    if (y)
      cout << -1 << '\n';
    else
      cout << cnt << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) solve();
}
