#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int i = 0, j = 1, n, m, x, a[300010], dp[300010], k;
  string s;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  dp[0] = a[0];
  for (i = 1; i < n; i++) {
    if (abs(dp[j] - a[i]) <= k) {
      j++;
      dp[j] = a[i];
    }
  }
  cout << j + 1 << endl;
  return 0;
}
