n = gets.to_i
h = gets.split.map(&:to_i)
h[0] -= 1

if (h[0] - h[1]) > 0
  puts "No"
  exit
else
  h[1] -= 1
end

1.upto(n-2) do |i|
  if (h[i] > h[i+1]) || (h[i-1] > h[i])
    puts "No"
    exit
  else
    h[i] -= 1
  end
end

puts "Yes"
