program main
implicit none
integer :: i, j, k, n, m
integer , allocatable :: h(:)

read(*,*) n
allocate( h(n) )
read(*,*) h(1:n)
m = 0
do i = 1, n
   if( h(i) .ge. m ) then
      m = h(i)
   else
      if( m-h(i) .ge. 2 ) then
         write(*,*) 'No'
         stop
      end if
   end if
end do
write(*,*) 'Yes'

end program main