#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m;
set<long long int> type;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, q, c;
  cin >> n >> q;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    m[arr[i]] = 0;
    type.insert(arr[i]);
  }
  for (long long int i = 0; i < n; i++) m[arr[i]]++;
  vector<long long int> v;
  for (auto it : type) v.push_back(it);
  reverse(v.begin(), v.end());
  while (q--) {
    cin >> c;
    long long int ay = 0, first = 0;
    for (auto x : v) {
      long long int av = m[x];
      if (av * x <= c) {
        ay += av;
        c -= av * x;
      } else {
        long long int req = c / x;
        c %= x;
        ay += req;
      }
    }
    if (c)
      cout << "-1\n";
    else
      cout << ay << endl;
  }
  return 0;
}
