N, K = map(int,input().split())
A = [int(input()) for i in range(N)]
cnt = 1
j = 1

for i in range(len(A)):
    flag = True
    if i + j > len(A) - 1:
        break
    else:
        if j != 1:
            j -= 1
            continue
        else:
            while flag:
                if i + j > len(A)-1:
                    break
                else:
                    if abs(A[i]-A[i+j])<=K:
                        cnt += 1
                        flag = False
                    else:
                        j += 1
        
        
print(cnt)