#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  while (k--) {
    int ans = 0;
    int q;
    cin >> q;
    if (q % 2 == 1) {
      cout << -1 << endl;
    } else {
      sort(arr, arr + n);
      reverse(arr, arr + n);
      for (int i = 0; i < n; i++) {
        q = q - arr[i];
        ans++;
        if (q <= 0) {
          break;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
