#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  bool split(vector<int>& nums, int k, int d) {
    int n = nums.size();
    sort(nums.begin(), nums.end());
    vector<int> dp(n + 1, 1);
    for (int i = max(0, k - 1), l = 0; i < n; ++i) {
      dp[i + 1] = dp[i];
      while (l < i && nums[l] + d < nums[i]) {
        ++l;
      }
      int r = i - k + 1;
      if (l > r) {
        continue;
      }
      int cnt = dp[r] - (l - 1 >= 0 ? dp[l - 1] : 0);
      if (cnt > 0) {
        ++dp[i + 1];
      }
    }
    return dp[n] - dp[n - 1] > 0;
  }
};
int main(int argc, char** argv) {
  int n, k, d;
  scanf("%d%d%d", &n, &k, &d);
  vector<int> A(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &A[i]);
  }
  Solution sol;
  if (sol.split(A, k, d)) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
