n, k = map(int, input().split())
a = [0]*n

for i in range(n):
    a[i] = int(input())

ansR = 1
ansL = 1

preR = a[-1]
preL = a[0]

for i in range(1, n):
    if abs(preL-a[i])<=k:
        preL = a[i]
        ansL += 1
    if abs(preR-a[i*(-1)-1])<=k:
        preR = a[i*(-1)-1]
        ansR += 1

print(max(ansL, ansR))