#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];
void solve() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (abs(a[i] - a[i - 1]) <= k) ans++;
  }
  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;
}
