def resolve():
    n, k = map(int, input().split())
    A = []
    for _ in range(n):
        A.append(int(input()))

    neg = 0
    for i in range(1, n):
        if abs(A[i - 1] - A[i]) > k:
            neg += 1
    print(n - neg)

resolve()