num = gets.to_i
array = gets.split.map(&:to_i)
i = 0
while i < num - 1
 array[i] -= 1 if array[i] > array[i + 1]
 i += 1  
end
if array.each_cons(2).all? {|a, b| a <= b }
 puts "Yes"
else
 puts "No"
end