def combi(n, m)
  return 1 if m == 0
  return n if m == 1
  return combi(n, n - m) if m > n - m
  fact_s(n, n - m + 1) / fact_s(m, 1)
end

def fact_s(n, m)
  (m..n).to_a.inject(&:*)
end

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

S.sort!.reverse!
flg, parent, child = [false, 0, 1]
(1..N).each{|i|
  wk = 0
  (N - i + 1).downto(1){|j|
    wk2 = combi(N - j, i - 1)
    (wk2 - wk).times{|k|
      (flg = true; break) if S[parent] <= S[child]
      parent += 1
      child += j
    }
    wk = wk2
    break if flg
  }
  break if flg
}

puts flg ? 'No' : 'Yes'
