N, K = map(int, input().split())
A = [int(input()) for _ in range(N)]

cnt = 0
for i in range(N):
    if abs(A[i] - A[i+1]) <= K:
        break
    cnt += 1

dq = [A[cnt]]
i = cnt + 1
while i < N:
    if abs(A[i] - A[i-1]) <= K and abs(A[i] - dq[-1]) <= K:
        dq.append(A[i])
    else:
        for s in range(1,min(len(dq), N-i-1)):
            l = abs(A[i+s] - dq[-s])
            r = abs(A[i+s+1] - A[i])
            if l <= K:
                break
            if r <= K:
                dq.append(A[i])
                i += 1
    i += 1
print(len(dq))
                
