#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 1000000000;
const int N = 100007, M = N;
long long i, j, cnt, par;
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<int> vec(n);
  long long ans = 0;
  for (int i = 0; i < n; i++) cin >> vec[i];
  for (int i = 1; i < n; i++) {
    if (vec[i] - vec[i - 1] <= k) ans++;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
