n = gets.chomp("").to_i

h = gets.split(" ").map(&:to_i)

max = h[0]

if n != 1
  (n-1).times do |i|
    if max-1 > h[i+1]
      puts "No"
      break
    else
      if max < h[i+1]
        max = h[i+1]
      end
    end

    if n-2 == i
      puts "Yes"
    end
  end
else
  puts "Yes"
end
