program c

implicit none
integer :: n,i
integer,allocatable,dimension(:) :: h

read*, n
allocate(h(n))
read*, h

h(1) = h(1) - 1

do i=2,n-1
if(h(i+1)<h(i)) then
h(i) = h(i) -1
end if
if((h(i+1)<h(i)).or.(h(i)<h(i-1))) then
write(*,'(a2)') 'No'
return
end if
end do

write(*,'(a3)') 'Yes'
end program