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

min = 9999999999999
(N - 1).downto(0) do |i|
  if hs[i] > min
    hs[i] -= 1
  else
    min = hs[i]
  end
end

if [*(0..(N - 2))].all? { |i| hs[i] <= hs[i + 1] }
  puts "Yes"
else
  puts "No"
end