n, k = map(int, input().split())
i = 0
z = 0
hikaku = []
result = []
ans = []
point = 0

while i < n:
    i += 1
    a = int(input())
    hikaku.append(a)

result.append(hikaku[0])
point = hikaku[0]

while z < len(hikaku)-1:
    if hikaku[z] != "na":
        if abs(point-hikaku[z+1]) <= k:
            result.append(hikaku[z+1])
            point= hikaku[z+1]
        else:
            hikaku[z] = "na"
    z += 1

ans = [y for y in result if y != "na"]
print(len(ans))