#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long Maxn = 1e9 + 7;
int ma[maxn];
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ma[i]);
  }
  sort(ma + 1, ma + n + 1);
  int flag = 0;
  if (ma[1] == 1) {
    flag = 1;
  }
  while (q--) {
    int a;
    int sum = 0;
    scanf("%d", &a);
    if (flag == 0 && a & 1) {
      printf("-1\n");
      continue;
    }
    if (a >= ma[n]) {
      sum += (a / ma[n]);
      a %= ma[n];
    }
    while (1) {
      if (a == 0) {
        break;
      }
      int pos = lower_bound(ma + 1, ma + n + 1, a) - ma;
      if (ma[pos] == a) {
        sum++;
        break;
      }
      if (pos - 1 < 1) {
        sum = -1;
        break;
      }
      pos--;
      sum += (a / ma[pos]);
      a %= ma[pos];
    }
    printf("%d\n", sum);
  }
  return 0;
}
