#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int binary(vector<int>& arr, int x) {
  int mid, start = 0;
  int end = arr.size() - 1;
  while (start <= end) {
    mid = start + (end - start) / 2;
    if (arr[mid] == x)
      return mid;
    else if (arr[mid] < x) {
      start = mid + 1;
    } else {
      end = mid - 1;
    }
  }
  return end;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q, i, j, b, no = 0, sum = 0, k = 0, temp;
  cin >> n >> q;
  vector<int> a, p;
  for (i = 0; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
    sum += a[i];
  }
  sort(a.begin(), a.end());
  while (q--) {
    scanf("%d", &b);
    if (b % 2 != 0 || sum < b)
      printf("-1\n");
    else {
      p = a;
      j = 0;
      no = b;
      while (1) {
        j++;
        k = binary(p, no);
        no = p[k];
        p.erase(p.begin() + k);
        b -= no;
        no = b;
        if (b == 0) {
          printf("%d\n", &j);
          break;
        } else if (b < 0 || b % 2 != 0) {
          printf("-1\n");
          break;
        }
      }
    }
  }
  return 0;
}
