# Your code here!
n = gets.chop!
str = gets.split

str.map!{|s| s.to_i}
# array = array.map{|n| n.to_i}

def test(str)
for e in 1...str.length
    if str[e] - 1 < str[e-1]
        return "no"
    elsif str[e] - 1 == str[e-1]
        str[e] = str[e] - 1
    end
end

return "yes"
end

print test(str)