number=gets.chomp.to_i
array = gets.chomp.split(" ").map(&:to_i)
jj = -1
array.each_with_index do |var, index|
 if jj <= var
   jj=[jj,var-1].max
 else
   puts "No"
   break
 end  
 if index == array.length-1 
   puts "Yes" 
 end  
end
