#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops"
using namespace std;
void mahakal() {}
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
const long long maxN = 3e5 + 5;
long long n, m, k, a[maxN];
long long dp[maxN];
void solve() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  dp[n] = 1;
  for (long long i = n - 1; i >= 1; i--) {
    if (abs(a[i] - a[i + 1]) <= k) {
      dp[i] = dp[i + 1] + 1;
    } else
      dp[i] = dp[i + 1];
  }
  long long ans = dp[1];
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) solve();
  return 0;
}
