program main
  implicit none

  integer :: n, a(100000), i

  read(*,*)n
  read(*,*)(a(i), i = 1, n)
  
  do i = 1, n - 1
    if ((a(i) - a(i+1)) > 0) then
      do j = i, n -1
        if ((a(i) - a(j)) >= 2) then
          write(*,*)"No"
          stop
        end if
      end do
    end if
  end do 
  write(*,*)"Yes"

end program main