#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T>& a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i) os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}
[[maybe_unused]] constexpr ll MOD = 998244353;
[[maybe_unused]] constexpr int INF = 0x3f3f3f3f;
[[maybe_unused]] constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;
int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n);
  for (ll& x : a) cin >> x;
  ll ans1 = 0;
  ll ans2 = 0;
  for (int i = 0; i < (n); ++i) {
    while (i + 1 < n && abs(a[i] - a[i + 1]) > k) ++i;
    ++ans1;
  }
  for (int i = 1; i < (n); ++i) {
    while (i + 1 < n && abs(a[i] - a[i + 1]) > k) ++i;
    ++ans2;
  }
  cout << max(ans1, ans2);
  return 0;
}
