#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e6 + 100;
long long n, q, b;
long long a[Maxn];
map<int, long long> m;
set<long long> s;
int main() {
  while (cin >> n >> q) {
    s.clear();
    m.clear();
    for (int i = 0; i < n; i++) cin >> a[i], m[a[i]]++, s.insert(a[i]);
    while (q--) {
      cin >> b;
      if (b & 1 && m[1] == 0)
        cout << -1 << endl;
      else {
        long long ans = 0, cnt = 0, flag = 0;
        for (set<long long>::iterator it = s.begin(); it != s.end(); it++)
          a[cnt++] = *it;
        for (int i = cnt - 1; i >= 0; i--) {
          if (b >= a[i] * m[a[i]])
            b -= (a[i] * m[a[i]]), ans += m[a[i]];
          else {
            int len = b / a[i];
            b -= len * a[i];
            ans += len;
          }
          if (b == 0) {
            flag = 1;
            break;
          }
        }
        if (!flag) ans = -1;
        cout << ans << endl;
      }
    }
  }
  return 0;
}
