#include <bits/stdc++.h>
using namespace std;
vector<long long> elements, pSum;
vector<long long>::iterator it;
int main() {
  long long v, soma;
  int n, q, left, right, mid, ans, aux, possivel;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &v);
    elements.push_back(v);
  }
  sort(elements.begin(), elements.end());
  pSum.push_back(elements[n - 1]);
  for (int i = 1; i < n; i++) pSum.push_back(pSum[i - 1] + elements[n - 1 - i]);
  for (int i = 0; i < q; i++) {
    scanf("%lld", &v);
    it = lower_bound(elements.begin(), elements.end(), v);
    left = 0;
    right = (it - elements.begin());
    if (right == n) right--;
    if (elements[right] > v and right > 0) right--;
    left = (n - 1) - right;
    aux = left - 1;
    right = (n - 1);
    possivel = -1;
    while (left <= right) {
      mid = (left + right) / 2;
      soma = pSum[mid];
      if (aux >= 0) soma -= pSum[aux];
      if (soma >= v) {
        if (soma == v) {
          ans = mid;
          possivel = max(possivel, mid);
        }
        right = mid - 1;
      } else {
        possivel = max(possivel, mid);
        left = mid + 1;
      }
    }
    if (possivel != -1) {
      v -= pSum[possivel];
      if (aux >= 0) v -= pSum[aux];
      possivel = (n - 1) - possivel - 1;
      ans = (n - 1) - possivel;
    } else
      possivel = n - 1;
    for (int j = possivel; j >= 0; j--) {
      if (v <= 0) break;
      if (elements[j] > v) continue;
      v -= elements[j];
      ans++;
    }
    if (v != 0LL)
      printf("-1\n");
    else
      printf("%d\n", ans);
  }
  return 0;
}
