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

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class Tester
{

    InputStream in;
    PrintWriter out;

    long mod=(long)1e9+7;
    int MAX=(int)1e6+7;
    double eps=1e-6;

    void solve()
    {
        int n=ni();
        int k=ni();
        long d=nl();
        long a[]=new long[n];
        for (int i=0;i<n;i++)
            a[i]=nl();
        Arrays.sort(a);

        int dp[]=new int[n];
        int prev=0;
        if (a[0]+d>=a[k-1])
        {
            dp[k-1]=1;
        }
        for (int i=k;i<n;i++)
        {
            dp[i]=dp[i-1];
            while (a[prev]+d<a[i] && prev<i)
                prev++;

            //tr(a[i],a[prev]);
            //prev--;
            dp[i]+=(dp[i]-dp[prev]>0)?1:0;
        }
        tr(dp);
        out.println(dp[n-1]>0?"YES":"NO");
    }

    class Pair implements Comparable<Pair>
    {
        int x;
        long y;
        long z;
        Pair(int a,long b,long c)
        {
            x=a;
            y=b;
            z=c;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair other = (Pair)o;
            return x == other.x && y == other.y;
        }
        public String toString()
        {
            return z+" "+y;
        }

        @Override
        public int compareTo(Pair o)
        {
            if (y==o.y)
                return Long.compare(z, o.z);
            else
                return Long.compare(y, o.y);


        }
        @Override public int hashCode()
        {
            return Objects.hash(x, y);
        }
    }

    long pow(long x, long n, long M) {
        x%=M;
        long result = 1;
        while (n > 0) {
            if (n % 2 == 1)
                result = (result * x) % M;
            x = (x * x) % M;
            n = n / 2;
        }
        return result;
    }

    long modInverse(long A, long M) {
        extendedEuclid(A, M);
        return (EEx % M + M) % M;
    }
    long EEd, EEx, EEy;

    void extendedEuclid(long A, long B) {
        if (B == 0) {
            EEd = A;
            EEx = 1;
            EEy = 0;
        } else {
            extendedEuclid(B, A % B);
            long temp = EEx;
            EEx = EEy;
            EEy = temp - (A / B) * EEy;
        }
    }

    int max(int a,int b)
    {
        if(a>b)
            return a;
        else
            return b;
    }

    int min(int a,int b)
    {
        if(a>b)
            return b;
        else
            return a;
    }

    long max(long a,long b)
    {
        if(a>b)
            return a;
        else
            return b;

    }


    long min(long a,long b)
    {
        if(a>b)
            return b;
        else
            return a;

    }

    long add(long a,long b)
    {
        long x=(a+b);
        while(x>=mod) x-=mod;
        return x;

    }


    long sub(long a,long b)
    {
        long x=(a-b);
        while(x<0) x+=mod;
        return x;

    }


    long mul(long a,long b)
    {
        a%=mod;
        b%=mod;
        long x=(a*b);
        return x%mod;

    }

    void run() throws Exception
    {
        String INPUT = "/Users/ayubsubhaniya/IdeaProjects/Test/src/input.txt";
        in = oj ? System.in : new FileInputStream(INPUT);
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        solve();
        out.flush();
        tr(System.currentTimeMillis() - s + "ms");

    }
    public static void main(String[] args) throws Exception
    {
        new Tester().run();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

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

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

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

    private double nd()
    {
        return Double.parseDouble(ns());
    }

    private char nc()
    {
        return (char) skip();
    }

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

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

    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++)
            map[i] = ns(m);
        return map;
    }

    private int[] na(int n)
    {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = ni();
        return a;
    }

    private int ni()
    {
        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 * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl()
    {
        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 * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

    private void tr(Object... o)
    {
        if (!oj)
            System.out.println(Arrays.deepToString(o));
    }

}