N = gets.chomp.to_i
H = gets.chomp.split.map(&:to_i)

before = nil
H.each_cons(3) do |a, b, c|
  candidates =
    if before
      ab = before.map {|x| [x[1], x[2]]}.uniq
      ab.flat_map do |_a, _b|
        [
          [_a, _b, c],
          [_a, _b, c - 1],
        ]
      end
    else
      [
        [a, b, c],
        [a, b, c - 1],
        [a, b - 1, c],
        [a, b - 1, c - 1],
        [a - 1, b, c ],
        [a - 1, b, c - 1],
        [a - 1, b -1, c],
        [a - 1, b -1, c - 1],
      ]
    end

  before = candidates.select do |x, y, z|
    x <= y && y <= z
  end
  (puts 'No'; exit) if before.size == 0
end
puts 'Yes'
