def abc(a, b, c)
#	print "#{a} #{b} #{c}\n"

	if a <= b and b <= c
		true
	elsif (a-1) <= b and b <= c
		true
	elsif a <= (b-1) and (b-1) <= c
		true
	elsif a <= b and b <= (c-1)
		true
	elsif (a-1) <= (b-1) and (b-1) <= c
		true
	elsif a <= (b-1) and (b-1) <= (c-1)
		true
	elsif (a-1) <= b and b <= (c-1)
		true
	else
		false
	end
end

def cc
	n = gets.chomp.to_i
	h = gets.chomp.split(/\s/).map{|x| x.to_i}

	a = 0
	b = 0
	c = 0

	for i in 1..n
		j = i - 1
		case j%3
		when 0
			a = h[j]
		when 1
			b = h[j]
		when 2
			c = h[j]
		end

		if n == 1
			puts 'Yes'
			exit
		elsif n == 2
			if a <= b or (a-1) <= b # or a <= (b-1)
				puts 'Yes'
			else
				puts 'No'
			end
			exit
		end

		if i <= 2
			next
		end

		d = true
		case j%3
		when 0
			d = abc(b, c, a)
		when 1
			d = abc(c, a, b)
		when 2
			d = abc(a, b, c)
		end

		if d
			next
		else
			puts 'No'
			exit
		end
	end

	puts 'Yes'
end

cc