N = gets.chop.to_i
P = gets.split.map(&:to_i)
P.sort!.reverse!
ans = 1
num = 1

def perm(n, k)
  ans = 1
  (0..(k-1)).each do |i|
    ans *= n-i
  end
  ans
end

def comb(n, k)
  perm(n, k) / perm(k, k)
end

if N == 1
  if P[0]==P[1]
    ans *= 0
  end
else
  (1..N).each do |n|
    com = comb(N, n)
    aaa = 0
    count = 0
    limit = N-n+1
    com.times do |c|
      if count == limit
        count = 0
        limit -= 1
        aaa += 1
      end
      parent = num-comb(N, n-1)+aaa
      if P[parent] <= P[num+c]
        ans *= 0
      end
      count += 1
    end
    num += com
  end
end

if ans==1
  print 'Yes'
else
  print 'No'
end
