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