public int solve() throws IOException {
        Reader.init(System.in);
        int N = Reader.nextInt();
        int x = Reader.nextInt();
        TreeSet<Integer> a = new TreeSet<>();
        for (int i = 0; i < N; i++) {
            a.add(Reader.nextInt());
        }
        
        if (x == 2) return 0;
        if (!a.isEmpty() && a.first() == 1) return 1;
        
        int i;
        for (i = 0; i < primes.size(); i++) {
            int p = primes.get(i);
            if (p >= x) break;
            if (!a.contains(p)) {
                return -1;
            }
        }
        return i;
    }