      PROGRAM buildStairs
      IMPLICIT NONE
      integer(16) :: n
      integer(16),allocatable :: h(:)
      integer(16) :: i
      
      
      read*,n
      allocate( h(n) )
      read*,h(1:n)
      
      do i = n,2,-1
        if( h(i-1)-1>h(i) )then
          print*,'No';stop
        else if( h(i-1)-1==h(i) )then
          h(i-1) = h(i-1) - 1
        end if
      end do
      
      print*,'Yes'
      
      
      
      
      
      
      
      END PROGRAM