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