#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5 + 5;
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> A(MAX, 0);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  vector<pair<int, int>> dp(MAX);
  dp.at(0) = make_pair(1, A.at(0));
  for (int i = 1; i < N; i++) {
    cerr << i << " abs = " << abs(dp.at(i).second - A.at(i)) << endl;
    if (abs(dp.at(i - 1).second - A.at(i)) <= K) {
      dp.at(i) = make_pair(dp.at(i - 1).first + 1, A.at(i));
    } else {
      dp.at(i) = dp.at(i - 1);
    }
  }
  for (int i = 0; i < N; i++) {
    cerr << "dp.at(" << i << ").first=" << dp.at(i).first << endl;
    cerr << "dp.at(" << i << ").second=" << dp.at(i).second << endl;
  }
  cout << dp.at(N - 1).first << endl;
}
