#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5;
int main() {
  int n, k, a[maxn];
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int cnt = 1, ans = 0;
  int b = a[0];
  for (int i = 1; i < n; i++) {
    if (abs(a[i] - b) <= k) {
      b = a[i];
      cnt++;
    }
  }
  cout << cnt;
}
