#include <bits/stdc++.h>
using namespace std;
bool compare1(pair<long long, long long> a1, pair<long long, long long> a2) {
  double aa = ((double)a1.first) / a1.second;
  double bb = ((double)a2.first) / a2.second;
  return aa > bb;
}
long long min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long hashs(string a) {
  long long k = 27;
  long long value = 0;
  for (long long i = 0; i < a.length(); i++) {
    value = ((value * k + (a[i] - 'a' + 1))) % 10000000000007;
  }
  return value;
}
long long find(long long parent[], long long i) {
  if (parent[i] != i) {
    parent[i] = find(parent, parent[i]);
  }
  return parent[i];
}
void unions(long long parent[], long long i, long long j) {
  long long k = find(parent, i);
  long long l = find(parent, j);
  parent[k] = l;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long bits[500001];
long long get_sum(long long bits[], long long index) {
  index += 1;
  long long sum = 0;
  while (index > 0) {
    sum += bits[index];
    index -= (index & -(index));
  }
  return sum;
}
void update(long long bits[], long long n, long long index, long long val) {
  index += 1;
  while (index <= n) {
    bits[index] += val;
    index += (index & (-index));
  }
}
int main() {
  long long n, k, d;
  cin >> n >> k >> d;
  long long arr[n];
  set<pair<long long, long long>> crr;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (long long i = 0; i < n; i++) {
    crr.insert(make_pair(arr[i], i));
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (i + k - 1 >= n || arr[i + k - 1] - arr[i] > d) {
      update(bits, n, i, 0);
    } else {
      auto it = crr.upper_bound(make_pair(arr[i] + d, 9999999));
      it--;
      if ((*it).second == n - 1) {
        update(bits, n, i, 1);
      } else {
        long long kk =
            get_sum(bits, (*it).second + 1) - get_sum(bits, i + k - 1);
        if (kk >= 1) {
          update(bits, n, i, 1);
        } else
          update(bits, n, i, 0);
      }
    }
  }
  if (get_sum(bits, 0) > 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
