#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

int main() {
    int N, K, after, before, count = 1;
    cin >> N >> K;
    cin >> before;
    for (int i = 1; i < N; i++) {
        cin >> after;
        if (abs(before - after) <= K) {
            before = after;
            count++;
        }
    }
    cout << count << endl;
    return 0;
}
