
def main():
    N, K = map(int, input().split())
    count = 1
    i = 1

    A = int(input())

    while i < N:
        Atemp = int(input())

        if abs(Atemp - A) <= K:
            count += 1
            A = Atemp

        i += 1
    
    print(count)



if __name__ == '__main__':
    main()