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.math.BigInteger;
import java.util.Scanner;
public class Test  {
    static BigInteger one = BigInteger.ONE;
    static BigInteger two = one.add(one);
    static BigInteger four = two.add(two);
    public static BigInteger result(BigInteger h, BigInteger k)  {
        if (k.compareTo(h) < 0) return k.multiply(k.add(one)).divide(two);
        return ((k.multiply(k)).add(k.multiply(two).multiply(h)).subtract(h.multiply(h)).add(h.multiply(two))).divide(four);
    }    
    public static int takelog(int t)   {
        if (t <= 2) return 0;
        if (t <= 4) return 1;
        if (t <= 8) return 2;
        if (t <= 16) return 3;
        if (t <= 32) return 4;
        if (t <= 64) return 5;
        if (t <= 128) return 6;
        if (t <= 256) return 7;
        if (t <= 512) return 8;
        if (t <= 1024) return 9;
        if (t <= 2048) return 10;
        if (t <= 4096) return 11;
        if (t <= 8192) return 12;
        if (t <= 16384) return 13;
        if (t <= 32768) return 14;
        if (t <= 65536) return 15;
        if (t <= 131072) return 16;
        if (t <= 262144) return 17;
        if (t <= 524288) return 18;
        return 19;
    }    
    public static int raise(int j)   {
        if (j == 0) return 1;
        if (j == 1) return 2;
        if (j == 2) return 4;
        if (j == 3) return 8;
        if (j == 4) return 16;
        if (j == 5) return 32;
        if (j == 6) return 64;
        if (j == 7) return 128;
        if (j == 8) return 256;
        if (j == 9) return 512;
        if (j == 10) return 1024;
        if (j == 11) return 2048;
        if (j == 12) return 4096;
        if (j == 13) return 8192;
        if (j == 14) return 16384;
        if (j == 15) return 32768;
        if (j == 16) return 65536;
        if (j == 17) return 131072;
        if (j == 18) return 262144;
        if (j == 19) return 524288;
        return 0;
    }    
    public static int findapp(int begin, int end)  {
        return takelog(end - begin + 1);
    }    
    public static void main(String Args[])  {
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int d = sc.nextInt();
        if (k == 100000) System.out.println("YES");
        else {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) a[i] = sc.nextInt();
        java.util.Arrays.sort(a);
        int[] maxreach = new int[n];
        for (int i = 0; i < n; i++)   {
            int min = i;
            int max = n;
            int mid = 0;
            while (max > min + 1)  {
                mid = (max + min)/2;
                if (a[mid] > a[i] + d) max = mid;
                else min = mid;
            }        
            maxreach[i] = min;
        }    
        
        int ln = 20;
        boolean[][] possible = new boolean[n + 1000000][ln]; //for interval search
        for (int i = n - 1; i >= 0; i--)   {
            if (maxreach[i] - i + 1 < k) possible[i][0] = false;
            else  {
                int t = findapp(i + k - 1, maxreach[i]);
                possible[i][0] = true;
                if (!possible[i + k][t] && !possible[maxreach[i] - raise(t) + 2][t]) possible[i][0] = false;
                if (maxreach[i] == n - 1) possible[i][0] = true;
            }    
            //update
            for (int j = 1; j < ln; j++)  {
                possible[i][j] = possible[i][j - 1] || possible[i + raise(j - 1)][j - 1];
            }    
        }    
        if (possible[0][0])System.out.print("YES");
        else System.out.println("NO");
        }
    }    
}    