#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
char tolower(char c) { return (c + 0x20); }
char toupr(char c) { return (c - 0x20); }
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int dp[n];
  for (int i = 0; i < n; i++) dp[i] = 0;
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - a[i - 1]) > k)
      dp[i] = dp[i - 1];
    else {
      dp[i] = dp[i - 1] + 1;
    }
  }
  cout << dp[n - 1] << endl;
}
