/**
 *    author:  Taichicchi
 *    created: 26.09.2020 21:09:03
 **/

#include <bits/stdc++.h>

#include <algorithm>
#include <atcoder/all>
#include <iostream>
#include <vector>

using namespace std;
using namespace atcoder;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main() {
    int N, K;

    cin >> N >> K;

    vector<int> A(N - 1);

    int a_1;
    cin >> a_1;

    int cnt = 0;

    rep(i, N - 1) {
        int a;
        cin >> a;

        if (abs(a - a_1) > K) {
            cnt++;
        }
        a_1 = a;
    }

    cout << N - cnt << endl;

    return 0;
}
