#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int dp[n];
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] - a[i + 1] <= k && a[i] - a[i + 1] >= -k)
      dp[i + 1] = dp[i] + 1;
    else
      dp[i + 1] = dp[i];
  }
  cout << dp[n - 1] << endl;
  return 0;
}
