#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
  }
  vector<long long int> dp(n);
  dp[n - 1] = 1;
  for (long long int i = n - 2; i >= 0; i--) {
    if (abs(v[i] - v[i + 1]) <= k) {
      dp[i] = dp[i + 1] + 1;
    } else {
      dp[i] = dp[i + 1];
    }
  }
  cout << dp[0] << "\n";
  return 0;
}
