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.*;
import java.io.*;
import java.math.BigInteger;
import java.text.*;

public class Main{
    static final long MOD = (long)1e9+7, IINF = (long)1e19;
    static final int MAX = (int)1e5+1, MX = (int)65e5+1, INF = (int)1e9, B = 18;
    static final double EPS = 1e-8;
    static FastReader in;
    static PrintWriter out;
    static boolean multipleTC = false;
    static DecimalFormat df = new DecimalFormat("0.0000000");
    public static void main(String[] args) throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        for(int i = 1, t = (multipleTC)?ni():1; i<=t; i++)solve(i);
        out.flush();
        out.close();
    }
    
    static void solve(int TC){
        int n = ni(), k = ni();
        long l = nl();
        long[] a = la(n);
        Arrays.sort(a);
        if(a[n-1]-a[0]<=l)pn("YES");
        else if(a[k-1]-a[0]>l)pn("NO");
        else{
            int ind = k, prev = 0;
            boolean yes = true;
            while(true){
                while(a[Math.min(ind+k-1, n-1)]-a[ind]>l && a[ind-1]-a[prev]<=l)ind++;
                if(a[Math.min(ind+k-1, n-1)] - a[ind]<=l){
                    if(Math.min(ind+k-1, n-1) == n-1)break;
                    else prev = ind;
                    ind++;
                }
                else if(a[ind-1]-a[prev]>l){
                    yes = false;
                    break;
                }
            }
            pn((yes)?"YES":"NO");
        }
    }
    static BigInteger one = BigInteger.valueOf(1),two = BigInteger.valueOf(2);
    static BigInteger f(BigInteger a){
        BigInteger o = a.multiply(a.add(one));
        o = o.divide(two);
        return o;
    }
    
    static long modPow(long a, long p){
        long o = 1;
        while(p>0){
            if(p%2==1)o = (a*o)%MOD;
            p/=2;
            a = (a*a)%MOD;
        }
        return o;
    }

    static int[] ia(int n){
        int[] out = new int[n];
        for(int i = 0; i< n; i++)out[i] = ni();
        return out;
    }

    static long[] la(int n){
        long[] out = new long[n];
        for(int i = 0; i< n; i++)out[i] = nl();
        return out;
    }

    static long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    static int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
    static void p(Object o){out.print(o);}
    static void pn(Object o){out.println(o);}
    static void pni(Object o){out.println(o);out.flush();}
    static String n(){return in.next();}
    static String nln(){return in.nextLine();}
    static int ni(){return Integer.parseInt(in.next());}
    static long nl(){return Long.parseLong(in.next());}
    static double nd(){return Double.parseDouble(in.next());}

    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

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

        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }
    }
}