N = gets.to_i
hs = gets.split.map(&:to_i)

(N-1).downto(1) do |i|
  if hs[i] >= hs[i-1]
    next
  else
    hs[i-1] -= 1
    if hs[i] >= hs[i-1]
      next
    else
      puts 'No'
      exit
    end
  end
end

puts 'Yes'