#include <bits/stdc++.h>
using namespace std;
long long n, k, d, a[500005], valid[500005], i = 0, j = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    cin >> n >> k >> d;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    valid[0] = 1;
    while ((i < n) && (j < n)) {
      if (valid[i])
        j = max(j, i + k - 1);
      else {
        i++;
        continue;
      }
      while ((j < n) && (a[j] - a[i] <= d)) {
        valid[j + 1] = 1;
        j++;
      }
      i++;
    }
    if (valid[n]) {
      cout << "YES";
    } else
      cout << "NO";
  }
  return 0;
}
