#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  int arr[n];
  map<int, int> mp;
  for (int i = 0; i < n; i++) scanf("%d", arr + i), mp[arr[i]]++;
  while (q--) {
    int x;
    scanf("%d", &x);
    int res = 0;
    for (auto it = mp.rbegin(); it != mp.rend() && x >= 0; it++)
      if (it->first <= x) {
        int xd = x / it->first;
        if (it->second < xd) {
          res += it->second;
          x -= (it->second * it->first);
        } else {
          res += xd;
          x -= (xd * it->first);
        }
      }
    if (x > 0) res = -1;
    printf("%d\n", res);
  }
  return 0;
}
