#include <bits/stdc++.h>
using namespace std;
long long int solve(long long int m, long long int n, long long int a[],
                    long long int b[]) {
  long long int i;
  {
    long long int count = 0;
    long long int j = m;
    for (i = n - 1; i >= 0; i--) {
      if (a[i] <= j) {
        j -= a[i];
        count++;
      }
      if (j <= 1000000) i = -1;
    }
    if (a[j] == -1)
      return -1;
    else
      return (count + b[j]);
  }
}
int main() {
  long long int n, q, i, j, l, m;
  cin >> n >> q;
  long long int count = 0;
  long long int a[1000001], sum = 0;
  for (i = 0; i < n; i++) {
    cin >> m;
    a[i] = m;
    sum += a[i];
  }
  sort(a, a + n);
  long long int b[1000001];
  b[0] = 0;
  for (i = 1; i <= 1000000; i++) {
    count = 0;
    m = i;
    if (sum > i) {
      for (j = n - 1; j >= 0; j--) {
        if (a[j] <= m) {
          count++;
          m -= a[j];
          if (m < i) j = -1;
          if (m == 0) j = -1;
        }
      }
      if (m == 0)
        b[i] = count;
      else if (m > 0) {
        if (i == m)
          b[i] = -1;
        else if (b[m] == -1)
          b[i] = -1;
        else
          b[i] = count + b[m];
      }
    } else
      b[i] = -1;
  }
  while (q--) {
    cin >> m;
    if (m <= 1000000)
      cout << b[m] << endl;
    else {
      if (sum < m)
        cout << "-1" << endl;
      else
        cout << solve(m, n, a, b) << endl;
    }
  }
}
