4 2 12
10 16 22 28
 10 3 1
5 5 5 6 6 7 8 8 8 9
 8 7 13
52 85 14 52 92 33 80 85
 10 5 293149357
79072863 760382815 358896034 663269192 233367425 32795628 837363300 46932461 179556769 763342555
 10 3 0
1 1 2 2 2 2 2 2 2 2
 10 4 28
5 5 6 6 30 30 32 33 50 55
 6 2 1
1 1 2 3 4 5
 6 3 3
1 1 1 1 1 5
 4 2 1
1 1 2 3
 6 3 2
1 2 3 3 4 5
 5 2 3
8 9 11 12 16
 10 3 3
1 1 2 4 5 6 9 10 11 12
 6 3 3
2 2 2 4 7 7
 3 2 257816048
1 999999999 999999999
 6 3 2
1 2 2 3 4 5
 9 3 2
1 2 2 3 4 5 6 7 7
 4 2 100
1 2 3 200
 7 3 3
6 8 9 10 12 13 14
 10 3 3
1 2 3 3 3 3 3 3 3 5
 10 4 9
47 53 33 48 35 51 18 47 33 11
 13 2 86
841 525 918 536 874 186 708 553 770 268 138 529 183
 7 3 3
1 2 4 6 7 8 10
 10 3 3
1 1 1 2 2 5 6 7 8 9
 6 2 2
1 2 3 4 6 7
 9 3 3
1 2 3 4 5 6 7 8 9
 18 2 86
665 408 664 778 309 299 138 622 229 842 498 389 140 976 456 265 963 777
 10 4 1
2 2 2 3 3 10 10 10 11 11
 3 2 76
44 5 93
 6 3 3
1 2 3 4 5 6
 8 4 5
1 1 1 1 1 9 9 9
 12 3 2
1 2 3 9 10 11 12 13 14 15 15 15
 8 3 6
1 2 3 3 4 7 11 11
 6 3 3
1 2 3 4 7 8
 10 4 15
20 16 6 16 13 11 13 1 12 16
 4 2 3
1 2 3 6
 7 3 3
1 1 3 4 4 4 7
 6 3 3
1 1 4 3 3 6
 6 3 4
1 2 3 4 6 7
 8 2 3
1 2 3 4 10 11 12 13
 6 2 2
2 3 4 5 6 8
 8 3 3
1 1 1 2 2 3 3 5
 18 3 1
1 1 1 2 2 3 5 5 5 6 6 7 9 9 9 10 10 11
 1 1 1
1
 16 2 2
3 3 3 4 5 6 7 9 33 33 33 32 31 30 29 27
 4 2 4
9 1 2 3
 3 2 2
6 7 7
 5 2 7
1 3 4 5 10
 5 2 9
3 8 9 14 20
 3 2 15
1 18 19
 5 2 3
1 2 3 4 100
 14 2 75
105 300 444 610 238 62 767 462 17 728 371 578 179 166
 7 3 3
1 2 3 4 4 5 5
 10 4 7
4 3 6 5 4 3 1 8 10 5
 6 3 4
1 1 3 5 8 10
 7 2 2
1 2 3 4 5 6 7
 15 8 57
40 36 10 6 17 84 57 9 55 37 63 75 48 70 53
 11 3 4
1 1 1 5 5 5 10 12 14 16 18
 8 3 6
1 2 3 3 7 4 11 11
 6 4 0
1 3 2 4 2 1
 5 2 3
5 7 7 7 10
 9 3 1
1 2 2 2 2 3 4 4 5
 11 3 1
1 1 2 2 3 3 3 4 4 5 5

YES
 YES
 NO
 NO
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 NO
 NO
 YES
 NO
 YES
 NO
 YES
 YES
 YES
 YES
 YES
 NO
 YES
 NO
 YES
 YES
 NO
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 NO
 YES
 YES
 YES
 NO
 NO
 YES
 YES
 YES
 NO
 YES
 NO
 NO
 YES
 NO
 YES
 YES
 YES

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Created by omar on 5/19/18.
 */
public class A {
    static int n, k, d, a[];

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        n = sc.nextInt();
        k = sc.nextInt();
        d = sc.nextInt();
        Integer[] tmp = new Integer[n];
        a = new int[n];
        for (int i = 0; i < n; i++)
            tmp[i] = sc.nextInt();
        Arrays.sort(tmp);
        for (int i = 0; i < n; i++)
            a[i] = tmp[i];
        SegmentTree st = new SegmentTree(new long[n + 2]);
        st.updateRange(1, 0, n + 1, 0, 0, 1);
        int lst = 0;
        int[] last = new int[n];
        for (int i = 0; i < n; i++) {
            while (lst + 1 < n && a[lst + 1] - a[i] <= d) lst++;
            last[i] = lst;


            if (st.queryRange(i, i) > 0 && lst - i + 1 >= k) {
                st.updateRange(1, 0, n + 1, i + k, lst + 1, 1);
            }
        }
        for (int i = n - 1; i >= 0; i--)
            if (last[i] == n - 1 && last[i]-i+1>=k && st.queryRange(i, i) > 0) {
                System.out.println("YES");
                return;
            }
        System.out.println("NO");
        out.flush();
    }

    static class SegmentTree {
        long[] tree, A, lazy;// startt starttorestart the index of the minimum number in the correstartponding range
        int N;

        SegmentTree(long[] in) {
            A = in.clone();
            N = A.length;
            tree = new long[(N << 1) << 1];
            lazy = new long[(N << 1) << 1];
            build(1, 0, N - 1);
        }

        void build(int node, int start, int end) {
            if (start == end) {
                // Leaf node will have a startingle element
                tree[node] = A[start];
            } else {
                int mid = (start + end) >> 1;
                // Recurstarte on the left child
                build(left(node), start, mid);
                // Recurstarte on the right child
                build(right(node), mid + 1, end);
                // Internal node will have the startum of both of itstart children
                tree[node] = tree[left(node)] + tree[right(node)];
            }
        }


        void updateRange(int node, int start, int end, int l, int r, int val) {
            if (lazy[node] != 0) {
                // Thistart node needstart to be updated
                tree[node] += 1l * (end - start + 1) * lazy[node];    // Update it
                if (start != end) {
                    lazy[left(node)] += lazy[node];                  // Mark child astart lazy
                    lazy[right(node)] += lazy[node];                // Mark child astart lazy
                }
                lazy[node] = 0;                                  // Restartet it
            }
            if (start > end || start > r || end < l)              // Current startegment istart not within range [l, r]
                return;
            if (start >= l && end <= r) {
                // startegment istart fully within range
                tree[node] += 1l * (end - start + 1) * val;
                if (start != end) {
                    // Not leaf node
                    lazy[left(node)] += val;
                    lazy[right(node)] += val;
                }
                return;
            }
            int mid = mid(start, end);
            updateRange(left(node), start, mid, l, r, val);        // Updating left child
            updateRange(right(node), mid + 1, end, l, r, val);   // Updating right child
            tree[node] = tree[left(node)] + tree[right(node)];        // Updating root with max value
        }

        long queryRange(int l, int r) {
            return queryRange(1, 0, N - 1, l, r);
        }

        long queryRange(int node, int start, int end, int l, int r) {
            if (start > r || end < l)
                return 0;         // Out of range
            if (lazy[node] != 0) {
                // Thistart node needstart to be updated
                tree[node] += (end - start + 1) * lazy[node];            // Update it
                if (start != end) {
                    lazy[left(node)] += lazy[node];         // Mark child astart lazy
                    lazy[right(node)] += lazy[node];    // Mark child astart lazy
                }
                lazy[node] = 0;                 // Restartet it
            }
            if (start >= l && end <= r) {           // Current startegment istart totally within range [l, r]
                return tree[node];
            }
            int mid = mid(start, end);
            long p1 = queryRange(left(node), start, mid, l, r);         // Query left child
            long p2 = queryRange(right(node), mid + 1, end, l, r); // Query right child
            return (p1 + p2);
        }

        static int mid(int start, int end) {
            return (start + end) >> 1;
        }

        static int left(int pos) {
            return pos << 1;
        }

        static int right(int pos) {
            return (pos << 1) + 1;
        }


    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader bf;

        Scanner(InputStream in) {
            bf = new BufferedReader(new InputStreamReader(in));
        }

        String next() throws Exception {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        int nextInt() throws Exception {
            return Integer.parseInt(next());
        }

        long nextLong() throws Exception {
            return Long.parseLong(next());
        }
    }
}