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