program ccc
 
implicit none
integer :: n,i
integer,allocatable,dimension(:) :: h
 
read*, n
allocate(h(n))
read*, h
 
h(1) = h(1) - 1

do i=1,n-1
if(h(i)<h(i+1)) then
h(i+1) = h(i+1) -1
end if
end do
do i=1,n-1
if((h(i)>h(i+1))) then
write(*,'(a2)') 'No'
!write(*,*) h
return
end if
end do
 
write(*,'(a3)') 'Yes'
!write(*,*) h
end program