#include <bits/stdc++.h>
using namespace std;
inline void p(vector<long long int> x, int n) {
  int i;
  for (i = 0; i < n; i++) cout << x[i] << " ";
  cout << endl;
}
void solve() {
  long long int M, K, i, j, tot, pos, ro = 0, re = 0, bo = 0, be = 0;
  long long int N;
  cin >> N >> K;
  vector<long long int> arr(N), dp(N, 0);
  dp[0] = 1;
  for (i = 0; i < N; i++) {
    cin >> arr[i];
  }
  long long int curr = arr[0];
  for (i = 1; i < N; i++) {
    if (abs(arr[i] - curr) <= K) {
      curr = arr[i];
      dp[i] = dp[i - 1] + 1;
    } else {
      dp[i] = dp[i - 1];
    }
  }
  cout << dp[N - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1, c = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
