#include<bits/stdc++.h>
#include <atcoder/all>
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

using namespace std;
using namespace atcoder;
using ll = long long;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int ans = n;
    rep(i, n) { 
        if (i == 0) continue;
        if (abs(a[i - 1] - a[i]) > k)ans--;       
    }
    cout << ans << endl;
    return 0;
}