#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
struct UnionFind {
  vector<int> d;
  UnionFind(int n = 0) : d(n, -1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y); }
  int size(int x) { return -d[find(x)]; }
};
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
  }
  vector<int> B;
  B.push_back(A[0]);
  int i = 0;
  int j = 1;
  while (j < N) {
    int now = A[i];
    int next = A[j];
    if (abs(now - next) <= K) {
      B.push_back(next);
      i = j;
      j++;
    } else {
      j++;
    }
  }
  cout << B.size() << endl;
}
