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.util.Scanner;


public class PencilsAndBoxes {
	private int n = 0;
	private int k = 0;
	private int d = 0;
	private int[] pencils = null;
	
	private void input() {
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		k = scanner.nextInt();
		d = scanner.nextInt();
		
		pencils = new int[n];
		
		for(int i = 0; i < n; i++) {
			pencils[i] = scanner.nextInt();
		}
		scanner.close();
	}
	
	private void quickSort(int[] array, int start, int end) {
		if(array == null) {
			return;
		}
		
		if(start >= end - 1) {
			return;
		}
		
		int front = start;
		int rear = end - 1;
		int keyIndex = (start + end) / 2;
		
		while(front < rear) {
			for(int j = rear; j >= keyIndex; j--) {
				rear = j;
				if(array[j] < array[keyIndex]) {
					int temp = array[keyIndex];
					array[keyIndex] = array[j];
					array[j] = temp;
					j = -1;
				}
			}
			for(int i = front; i <= keyIndex; i++) {
				front = i;
				if(array[i] > array[keyIndex]) {
					int temp = array[keyIndex];
					array[keyIndex] = array[i];
					array[i] = temp;
					i = end + 1;
				}
			}
		}
		quickSort(array, start, keyIndex);
		quickSort(array, keyIndex + 1, end);
	}
	
	public void sort(int[]a,int low,int high)
	{
        int start = low;
        int end = high;
        int key = a[low];
        
        
        while(end>start){
            //从后往前比较
            while(end>start&&a[end]>=key)  //如果没有比关键值小的，比较下一个，直到有比关键值小的交换位置，然后又从前往后比较
                end--;
            if(a[end]<=key){
                int temp = a[end];
                a[end] = a[start];
                a[start] = temp;
            }
            //从前往后比较
            while(end>start&&a[start]<=key)//如果没有比关键值大的，比较下一个，直到有比关键值大的交换位置
               start++;
            if(a[start]>=key){
                int temp = a[start];
                a[start] = a[end];
                a[end] = temp;
            }
        //此时第一次循环比较结束，关键值的位置已经确定了。左边的值都比关键值小，右边的值都比关键值大，但是两边的顺序还有可能是不一样的，进行下面的递归调用
        }
        //递归
        if(start>low) sort(a,low,start-1);//左边序列。第一个索引位置到关键值索引-1
        if(end<high) sort(a,end+1,high);//右边序列。从关键值索引+1到最后一个
    }
	
	
	private boolean calculate() {
		boolean[] dp = new boolean[500100];
		dp[0] = true;
		int pos = k - 1;
		
		for(int i = 0; i < n; i++) {
			if(dp[0]) {
				for(int j = (pos > i)?pos:i; j < n; j ++) {
					//System.out.println(j +" " + i);
					if(pencils[j] - pencils[i] <= d && (j - i >= (k - 1)) && dp[i]) {
						//System.out.println("true");
						dp[j + 1] = true;
						pos = j + 1;
					}else {
						//j = n;
						if ((j - i >= k - 1) || (pencils[j] - pencils[i] > d)) {
							j = n;
						}
					}
				}
			}
		}
		//Util.printBooleanArray(dp, 0, 6);
		return dp[n];
	}

	public void run() {
		input();
		quickSort(pencils, 0 ,pencils.length);

		if(calculate()) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		PencilsAndBoxes instance = new PencilsAndBoxes();
		instance.run();
	}
}
