N, K = input().split()
K = int(K)
count = 1  # 最初は必ず含む
A1 = int(input())
l = []
l.append(A1)
for i in range(int(N)-1):
    A2 = int(input())
    if abs(A2 - A1) <= K:
        l.append(A2)
        count += 1
        A1 = A2
    else:
        pass
print(count)
