n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
i = 0
j = 1
if n == 1
    puts "Yes"
    exit
end

until j == n 
    if h[i] < h[j]
        h[j] = h[j] - 1
    end
    if h[i] > h[j]
        puts "No"
        exit
    end
    j += 1
    i += 1
end
puts "Yes"
