#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline bool chmin(A &a,const B &b){if(a>b){a=b;return true;}else{return false;}}
template<typename A,typename B>inline bool chmax(A &a,const B &b){if(a<b){a=b;return true;}else{return false;}}

int main()
{
    int N,K;
    cin >> N >> K;
    vint A(N);
    cin >> A;
    vint suff(N);
    REP(i,N){
        suff[i] = i;
    }
    vint ans;
    for(int i=1; i<N; i++){
        if(K >= abs(A[i]-A[i-1])){
            if(ans.size() == 0){
                ans.pb(A[i-1]);
            }
            ans.pb(A[i]);
        }
    }
    cout << ans.size() <<endl;
}