#include <bits/stdc++.h>   using namespace std;   void sprint(string s) {     for (int i = 0; i < s.size(); ++i) printf( %c , s[i]);     printf(  n );   }   int main() {     int n, k, d;     cin >> n >> k >> d;     int a[n];     int b[n];     for (int i = 0; i < n; ++i) {       scanf( %d , &a[i]);       b[i] = 0;     }     sort(a, a + n);     if (k == 1) b[n - 1] = 1;     for (int i = n - 2; i >= 0; --i) {       if (n - i < k) continue;       if (n - i >= k and a[n - 1] - a[i] <= d)         b[i] = b[i + 1] + 1;       else if (a[i + k - 1] - a[i] > d)         b[i] = b[i + 1];       else {         auto it = upper_bound(a, a + n, a[i] + d);         it--;         int id = it - a;         if (id < i + k - 1) {           b[i] = b[i + 1];         } else {           id++;           if (id == n - 1) {             if (b[i + k])               b[i] = b[i + 1] + 1;             else               b[i] = b[i + 1];           } else {             if (b[i + k] - b[id + 1] > 0)               b[i] = b[i + 1] + 1;             else               b[i] = b[i + 1];           }         }       }     }     for (int i = 0; i < n; ++i) {     }     if (n == 1) {       printf( YEs n );     } else if (b[0] - b[1])       printf( YES n );     else       printf( NO n );     return 0;   }   