#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int n;
int dp[1000][1000];
int ans(int i, int x) {
  if (i >= n || x < 0) return 1e9 + 7;
  if (dp[i][x] >= 0) return dp[i][x];
  if (!x) return dp[i][x] = 0;
  return dp[i][x] = min(ans(i + 1, x), 1 + ans(i + 1, x - a[i]));
}
int main() {
  memset(dp, -1, sizeof dp);
  int i, q, x;
  cin >> n >> q;
  for (i = 0; i < n; ++i) {
    cin >> x;
    a.push_back(x);
  }
  while (q--) {
    cin >> x;
    int y = ans(0, x);
    if (y == 1e9 + 7)
      cout << "-1\n";
    else
      cout << y << "\n";
  }
}
