n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
i = 1
while true
    if n == 1
        puts "Yes"
        exit
       end
   if  h[i-1] -1 > h[i]
     puts "No"
     exit
   end
   i += 1
   if i == h.size
    puts "Yes"
    exit
   end
end