def stairs?(list)
  list.size.times do |i|
    nxt = list[i+1]
    if nxt.nil?
      break
    end
    
    if list[i] > nxt
      return false
    end
  end
  return true
end

n = gets.to_i
h_list = gets.split.map(&:to_i)

n.times do |i|
  [0, 1].each do |j|
    h_list[i] = h_list[i] - j
    if stairs?(h_list)
      puts 'Yes'
      exit
    end
  end
end

puts 'No'