N = gets.to_i
S = gets.split.map(&:to_i).sort

queue = []
origin = S.pop
queue << [origin, 0]

until queue.empty?
  parent, gene = queue.shift

  # p [:parent, parent, :gene, gene, S]

  (gene + 1).upto(N) do |g|
    child = S.pop

    if parent <= child
      puts 'No'
      exit
    end

    queue << [child, g]
  end
end

puts 'Yes'
