#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
inline void IN(void) { return; }
template <typename F, typename... R>
inline void IN(F& f, R&... r) {
  cin >> f;
  IN(r...);
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n, k;
  IN(n, k);
  vector<int> a(n);
  for (ll II = 0; II < ll(n); II++) cin >> a[II];
  vector<int> dp(3000001, 0);
  vector<int> cnt(3000001, 0);
  dp[0] = 1;
  int len = 0;
  int last = a[0];
  for (ll i = 1; i < ll(n); i++) {
    int t = abs(a[i] - a[i - 1]);
    dp[i] = dp[i - 1];
    if (t <= k) {
      if (abs(a[i] - last) <= k) dp[i]++;
      len = 0;
      last = a[i];
    } else {
      len++;
      for (ll j = 2; j < ll(len + 1); j++) {
        int s = abs(a[i] - a[i - j]);
        if (s <= k) {
          len = 0;
          dp[i]++;
        }
      }
    }
  }
  cout << dp[n - 1] << '\n';
  return 0;
}
