line = input().rstrip().split(" ")
num = int(line[0])
diffirence = int(line[1])
lastdigit = int(input().rstrip())
answerlist = [lastdigit]

for i in range(num - 1):
    digit = int(input().rstrip())
    if abs(digit - lastdigit) <= diffirence:
        answerlist.append(digit)
        lastdigit = digit

print(len(answerlist))