def test(n,hlist)
  max = hlist[0]
  (0..n-2).all?{|i|
    a = hlist[i]
    b = hlist[i+1]
    ret = a<=b || (a-1<=b && max<=a-1)
    max = [a-1,max].max
    puts "#{a} #{b} #{ret} #{max}"
    ret
  }
end
puts test(gets.to_i,gets.split(' ').map(&:to_i)) ? 'Yes' : 'No'
