#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int a[maxn];
int n, k, d;
class bit {
 public:
  long long node[maxn];
  int lb(int x) { return x & (-x); }
  void update(int pos, long long val) {
    if (pos > 0)
      for (int i = pos; i <= n; i += lb(i)) node[i] += val;
  }
  long long ask(int pos) {
    long long sum = 0;
    if (pos > 0)
      for (int i = pos; i; i -= lb(i)) sum += node[i];
    return sum;
  }
  long long query(int l, int r) { return ask(r) - ask(l - 1); }
} tree;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> d;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = k; i <= n; i++) {
    int r = i - k;
    int l1 = 1, r1 = i - 1, l = i;
    while (l1 <= r1) {
      int mid = (l1 + r1) / 2;
      if (a[i] - a[mid] <= d)
        l = mid, r1 = mid - 1;
      else
        l1 = mid + 1;
    }
    l--;
    if (r < l) continue;
    int temp = (tree.query(l, r) > 0);
    temp |= (l == 0);
    if (temp) tree.update(i, 1);
    if (i == n) {
      if (temp)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
