#include <bits/stdc++.h>
using namespace std;
long long int a[300001];
int main() {
  long long int N, i, K, prev, cnt;
  cin >> N >> K;
  for (i = 0; i < N; i++) {
    cin >> a[i];
  }
  prev = a[0];
  cnt = 1;
  for (i = 1; i < N; i++) {
    if (abs(a[i] - prev) <= K) {
      prev = a[i];
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}
