math_num = gets.to_i
heights = gets.split(" ").map(&:to_i)

result = 'Yes'
if heights.length == 1
else
  for i in (1..heights.length-1) do
    if heights[i-1] <= heights[i] + 1
      next
    else
	  result = 'No'
      exit
    end
  end
end
puts result