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

/**
 * Created by Aminul on 5/22/2018.
 */

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class E_2 {
    public static void main(String[] args) throws Exception {
        FastReader in = new FastReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = in.nextInt(), k = in.nextInt(), d = in.nextInt();
        int arr[] = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            arr[i] = in.nextInt();
        }

        arr = radixSort(arr);
        TreeMap<Integer, Integer> map = new TreeMap<>();
        LST bit = new LST(n + 5);
        bit.set(n + 1);


        for (int i = n; i >= 1; i--) {
            int x = arr[i];
            map.putIfAbsent(x, i);
            if (i + k - 1 > n) continue;
            int left = i + k - 1, right = map.floorEntry(x + d).getValue();
            if (arr[left] - x <= d) {
                if (bit.next(left + 1) <= right + 1) {
                    bit.set(i);
                }
            }
        }

        boolean ok = bit.get(1);
        if (ok) pw.println("YES");
        else pw.println("NO");

        pw.close();
    }

    public static int[] radixSort(int[] f) {
        return radixSort(f, f.length);
    }

    public static int[] radixSort(int[] f, int n) {
        int[] to = new int[n];
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) b[1 + (f[i] & 0xffff)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < n; i++) to[b[f[i] & 0xffff]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) b[1 + (f[i] >>> 16)]++;
            for (int i = 1; i <= 65536; i++) b[i] += b[i - 1];
            for (int i = 0; i < n; i++) to[b[f[i] >>> 16]++] = f[i];
            int[] d = f;
            f = to;
            to = d;
        }
        return f;
    }

    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    public static class LST { //from UWI
        public long[][] set;
        public int n;
//		public int size;

        public LST(int n) {
            this.n = n;
            int d = 1;
            for (int m = n; m > 1; m >>>= 6, d++) ;

            set = new long[d][];
            for (int i = 0, m = n >>> 6; i < d; i++, m >>>= 6) {
                set[i] = new long[m + 1];
            }
//			size = 0;
        }

        int cardinality(){
            int ones = 0;
            for(long s[] : set){
                for(long t : s) ones += Long.bitCount(t);
            }
            return ones;
        }

        private static int prev(long set, int n) {
            long h = set << ~n;
            if (h == 0L) return -1;
            return -Long.numberOfLeadingZeros(h) + n;
        }

        private static int next(long set, int n) {
            long h = set >>> n;
            if (h == 0L) return -1;
            return Long.numberOfTrailingZeros(h) + n;
        }

        // [0,r)
        public LST setRange(int r) {
            for (int i = 0; i < set.length; i++, r = r + 63 >>> 6) {
                for (int j = 0; j < r >>> 6; j++) {
                    set[i][j] = -1L;
                }
                if ((r & 63) != 0) set[i][r >>> 6] |= (1L << r) - 1;
            }
            return this;
        }

        // [0,r)
        public LST unsetRange(int r) {
            if (r >= 0) {
                for (int i = 0; i < set.length; i++, r = r + 63 >>> 6) {
                    for (int j = 0; j < r + 63 >>> 6; j++) {
                        set[i][j] = 0;
                    }
                    if ((r & 63) != 0) set[i][r >>> 6] &= ~((1L << r) - 1);
                }
            }
            return this;
        }

        public LST set(int pos) {
            if (pos >= 0 && pos < n) {
//				if(!get(pos))size++;
                for (int i = 0; i < set.length; i++, pos >>>= 6) {
                    set[i][pos >>> 6] |= 1L << pos;
                }
            }
            return this;
        }

        public LST unset(int pos) {
            if (pos >= 0 && pos < n) {
//				if(get(pos))size--;
                for (int i = 0; i < set.length && (i == 0 || set[i - 1][pos] == 0L); i++, pos >>>= 6) {
                    set[i][pos >>> 6] &= ~(1L << pos);
                }
            }
            return this;
        }

        public boolean get(int pos) {
            return pos >= 0 && pos < n && set[0][pos >>> 6] << ~pos < 0;
        }

        public LST toggle(int pos) {
            return get(pos) ? unset(pos) : set(pos);
        }

        public int prev(int pos) {
            for (int i = 0; i < set.length && pos >= 0; i++, pos >>>= 6, pos--) {
                int pre = prev(set[i][pos >>> 6], pos & 63);
                if (pre != -1) {
                    pos = pos >>> 6 << 6 | pre;
                    while (i > 0) pos = pos << 6 | 63 - Long.numberOfLeadingZeros(set[--i][pos]);
                    return pos;
                }
            }
            return -1;
        }

        public int next(int pos) {
            for (int i = 0; i < set.length && pos >>> 6 < set[i].length; i++, pos >>>= 6, pos++) {
                int nex = next(set[i][pos >>> 6], pos & 63);
                if (nex != -1) {
                    pos = pos >>> 6 << 6 | nex;
                    while (i > 0) pos = pos << 6 | Long.numberOfTrailingZeros(set[--i][pos]);
                    return pos;
                }
            }
            return -1;
        }

        @Override
        public String toString() {
            List<Integer> list = new ArrayList<Integer>();
            for (int pos = next(0); pos != -1; pos = next(pos + 1)) {
                list.add(pos);
            }
            return list.toString();
        }
    }

    static class FastReader {
        static final int ints[] = new int[128];
        InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0, ptrbuf = 0;

        public FastReader(InputStream is) {
            for (int i = '0'; i <= '9'; i++) ints[i] = i - '0';
            this.is = is;
        }

        public int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        public int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        public String next() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + ints[b];
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + ints[b];
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
       /* public char nextChar() {
            return (char)skip();
        }*/

        public char[] next(int n) {
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while (p < n && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        /*private char buff[] = new char[1005];
        public char[] nextCharArray(){
            int b = skip(), p = 0;
            while(!(isSpaceChar(b))){
                buff[p++] = (char)b;
                b = readByte();
            }
            return Arrays.copyOf(buff, p);
        }*/
    }
}