#include <bits/stdc++.h>
using namespace std;
static int n, q, nums;
static vector<int> ve;
static map<int, int> hashs;
int main() {
  while (scanf("%d%d", &n, &q) != EOF) {
    ve.clear();
    hashs.clear();
    for (int i = 0; i < n; i++) {
      scanf("%d", &nums);
      ++hashs[nums];
    }
    for (auto& v : hashs) ve.push_back(v.first);
    for (int i = 0; i < q; i++) {
      scanf("%d", &nums);
      auto it = lower_bound(ve.begin(), ve.end(), nums);
      if (it != ve.end() && *it == nums) {
        printf("1\n");
      } else if (it != ve.begin()) {
        int ans = 0;
        for (int i = it - ve.begin() - 1; i >= 0; i--) {
          if (nums >= hashs[ve[i]] * ve[i]) {
            nums -= hashs[ve[i]] * ve[i];
            ans += hashs[ve[i]];
          } else if (nums > 0) {
            ans += nums / ve[i];
            nums %= ve[i];
          }
        }
        if (nums > 0)
          printf("-1\n");
        else
          printf("%d\n", ans);
      }
    }
  }
  return 0;
}
