#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int a[maxn];
int dp[maxn];
void solved() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (abs(a[i] - a[i - 1]) <= k) {
      dp[i] = dp[i - 1] + 1;
    } else {
      dp[i] = dp[i - 1];
    }
  }
  cout << dp[n] << endl;
}
int main() {
  solved();
  return 0;
}
