program answer
  implicit none
  integer(8) :: i, N, K, ans
  integer(8), allocatable :: A(:)
  read(*,*) N, K
  allocate(A(N))
  do i = 1, N
     read(*,*) A(i)
  end do
  ans=1
  do i = 1, N-1
     if(abs(A(i)-A(i+1))<=K) then
        ans=ans+1
     end if
  end do

  write(*,*) ans
  stop
 end program answer