#include <bits/stdc++.h>
using namespace std;
void solve(void) {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  vector<int> dp(n, 0);
  dp[0] = 1;
  for (int i = 1; i < n; ++i) {
    dp[i] = dp[i - 1];
    if (abs(a[i - 1] - a[i]) <= k) dp[i]++;
  }
  cout << dp[n - 1] << endl;
}
int main(void) { solve(); }
