#include <bits/stdc++.h>
using namespace std;
map<long long, long long> cant;
int n, q;
int Query(long long b) {
  auto k = cant.end();
  int used = 0;
  k--;
  while (true) {
    long long d = b / k->first;
    b -= min(d, k->second) * k->first;
    used += min(d, k->second);
    if (b == 0) return used;
    if (k == cant.begin()) return -1;
    k--;
  }
  return -1;
}
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    cant[a]++;
  }
  for (int i = 0; i < q; i++) {
    int b;
    scanf("%d", &b);
    printf("%d\n", Query(b));
  }
}
