#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
template <class T>
using min_heap = priority_queue<T, std::vector<T>, std::greater<T> >;
const int LM = 5e5, MAX = 1e9;
int a[LM], n, k, d, l, r, m, dp[LM];
vector<int> in, val;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  dp[0] = 1;
  in.push_back(0);
  val.push_back(a[1]);
  for (int i = 1; i <= n; i++) {
    auto b1 = upper_bound(in.begin(), in.end(), i - k);
    auto b2 = lower_bound(val.begin(), val.end(), a[i] - d);
    int i1 = b1 - in.begin() - 1;
    int i2 = b2 - val.begin();
    if (i2 <= i1) {
      dp[i] = 1;
      in.push_back(i);
      val.push_back(a[i + 1]);
    }
  }
  if (dp[n])
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
