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