integer N,baseline
integer,allocatable,dimension(:)::H
logical check
read*,N
allocate(H(N))
read*,H
check=.true.
baseline=H(1)-1
do i=2,N
  if(H(i)>=baseline+1)baseline=H(i)-1
  if(H(I) < baseline)check=.false.
end do
print"(A)",merge("Yes","No ",check)
end