#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e8;
int ToggleBit(int n, int X) { return n ^ (1 << X); }
int SetBit(int n, int X) { return n | (1 << X); }
int ClearBit(int n, int X) { return n & ~(1 << X); }
bool CheckBit(int n, int X) { return (bool)(n & (1 << X)); }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  vector<int> v;
  int j = 0;
  for (int i = 1; i < n - 1; i++) {
    if (abs(a[i] - a[j] <= m)) {
      j = i;
      v.push_back(1);
    }
  }
  cout << v.size() + 1 << "\n";
  return 0;
}
