def readInt():
    return list(map(int, input().split()))

a_l = []
ans = 0

n, k = readInt()
for i in range(n):
    a = int(input())
    if len(a_l)==0:
        a_l.append(a)
        b = a
    else:
        if abs(b - a) <= k:
            a_l.append(a)
            b = a
print(len(a_l))
