n = gets.to_i

hs = gets.chomp.split(" ").map(&:to_i)

last = hs[0]
for i in 1...n do
  if last < hs[i] then
    last = hs[i]
  elsif hs[i] == last || hs[i] == last - 1 then
  else
    puts 'no'
    return
  end
end
puts 'yes'