#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, cnt = 1;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int before = A.at(0);
  for (int i = 1; i < N; i++) {
    if (abs(A.at(i) - before) <= K) {
      cnt++;
      before = A.at(i);
    }
  }
  cout << cnt << endl;
}
