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.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.flush();out.close();
    }
        static class TaskE {
          class pair{
           int l,r;pair(int a,int b){l=a;r=b;}
           public String toString(){return l+" "+r;}
          }
          public void solve(int testNumber, InputReader in, PrintWriter out) {
              int n=in.nextInt(),k=in.nextInt(),d=in.nextInt();
              ArrayList<Integer> al=new ArrayList<>();
              for(int i=0;i<n;i++)al.add(in.nextInt());
              Collections.sort(al);
              int p=0;boolean is=true,not=false;
              ArrayList<pair > range=new ArrayList<>();
              while(p<n){
               if(p+k-1>=n){not=true;range.add(new pair(p,n-1));break;}
               int f=al.get(p),s=al.get(p+k-1);
               if(s>f+d){
                is=false;break;
               }
               int i;
               for(i=p+k;i<n;i++){
                if(al.get(i)>f+d){
                 break;
                }
               }range.add(new pair(p,i-1));p=i;
              }
              if(!is){out.print("NO");return;}
              if(!not){out.print("YES");return;}
              int l=range.size();
//              System.out.print(range);
              for(int i=l-1;i>0;i--){
               pair r=range.get(i);
               int ep=r.r-r.l+1;
               if(ep>=k)break;
               pair r1=range.get(i-1);
               int f=al.get(r1.r-(k-ep-1));
               int s=al.get(r.r);
               if(s>f+d){
                not=false;break;
               }
               range.get(i-1).r=r1.r-(k-ep);
              }
//              System.out.print(range);
              if(range.get(0).r-range.get(0).l+1<k||!not)out.print("NO");
              else out.print("YES");
          }
//          int ja[][],from[],to[],c[];
//              void make(int n,int m,InputReader in){
//               ja=new int[n+1][];from=new int[m];to=new int[m];c=new int[n+1];
//               for(int i=0;i<m;i++){
//                from[i]=in.nextInt();to[i]=in.nextInt();
//                c[from[i]]++;c[to[i]]++;
//               }
//               for(int i=1;i<=n;i++){
//                ja[i]=new int[c[i]];c[i]=0;
//               }
//               for(int i=0;i<m;i++){
//                ja[from[i]][c[from[i]]++]=to[i];
//                ja[to[i]][c[to[i]]++]=from[i];
//               }
//              }
//        pair[] radixSort(pair[] f){ return radixSort(f, f.length); }
//	pair[] radixSort(pair[] f, int n)
//	{
//		pair[] to = new pair[n];
//		{
//			int[] b = new int[65537];
//			for(int i = 0;i < n;i++)b[1+(f[i].v&0xffff)]++;
//			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
//			for(int i = 0;i < n;i++){
//                         to[b[f[i].v&0xffff]++] = f[i];
//                        }
//			pair[] d = f; f = to;to = d;
//		}
//		{
//			int[] b = new int[65537];
//			for(int i = 0;i < n;i++)b[1+(f[i].v>>>16)]++;
//			for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
//			for(int i = 0;i < n;i++)to[b[f[i].v>>>16]++] = f[i];
//			pair[] d = f; f = to;to = d;
//		}
//		return f;
//	}
//        
//        private static final int B1 = 31;
//	private static final int M1 = 1000000007;
//	private static final int Z1 = 16983;
//	private static final int B2 = 37;
//	private static final int M2 = 1000000009;
//	private static final int Z2 = 18657;
//	
//	public static long unrootedHash(int[][] g)
//	{
//		int[] cs = center(g);
//		long[] lhs = new long[cs.length];
//		int p = 0;
//		for(int c : cs){
//			lhs[p++] = rootedHash(c, -1, g);
//		}
//		Arrays.sort(lhs);
//		long hl = Z1, hr = Z2;
//		for(long lh : lhs){
//			long lhl = lh>>>32, lhr = (int)lh;
//			hl = (hl * B1 + lhl*lhl) % M1;
//			hr = (hr * B2 + lhr*lhr) % M2;
//		}
//		return hl<<32|hr;
//	}
//	
//	public static long rootedHash(int cur, int pre, int[][] g)
//	{
//		long[] hs = new long[g[cur].length];
//		int p = 0;
//		for(int e : g[cur]){
//			if(e != pre){
//				hs[p++] = rootedHash(e, cur, g);
//			}
//		}
//		Arrays.sort(hs, 0, p);
//		long hl = Z1, hr = Z2;
//		for(int i = 0;i < p;i++){
//			hl = (hl * B1 + hs[i]*hs[i]) % M1;
//			hr = (hr * B2 + hs[i]*hs[i]) % M2;
//		}
//		return hl<<32|hr;
//	}
	
       }
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}