#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, d;
  cin >> n >> k >> d;
  vector<int> a(n, 0);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a.begin(), a.end());
  vector<int> dp(n, 0);
  vector<int> sum(n, 0);
  int p = 0;
  if (k == 1) {
    dp[0] = 1;
  } else {
    dp[0] = 0;
  }
  sum[0] = dp[0];
  for (int i = 1; i < n; ++i) {
    while (a[i] - a[p] > d) {
      ++p;
    }
    if (p > i - k + 1) {
      dp[i] = 0;
    } else {
      if (i - k >= 0) {
        int s = sum[i - k];
        if (p > 1) {
          s -= sum[p - 2];
        }
        if (p == 0) {
          ++s;
        }
        if (s > 0) {
          dp[i] = 1;
        } else {
          dp[i] = 0;
        }
      } else {
        dp[i] = 1;
      }
    }
    sum[i] = sum[i - 1] + dp[i];
  }
  if (dp[n - 1]) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
