program main
 implicit none
 integer*8 N,i,flag
 integer*8, allocatable::H(:)
 read(*,*) N
 allocate(H(1:N))
 read(*,*) H
 
 flag = 0
 do i=N,2,-1
  if(H(i-1) - H(i) > 1) then
   flag = 1
   exit
  else if(H(i-1) - H(i) == 1) then
   H(i-1) = H(i-1) - 1
  end if
 end do
 
 if(flag == 0) then
  write(*,*) 'Yes'
 else 
  write(*,*) 'No'
 end if
end program main