def foo(n, h)
	(0...n - 1).each { |i|
		gap = h[i] - h[i + 1]
		if gap > 1
			return "No"
		elsif gap == 1
			h[i + 1] += 1
		end
	}
	"Yes"
end

n = gets.chomp.to_i
h = gets.split.map(&:to_i)
puts foo(n, h)