object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val length = sc.nextInt()
    val input = Array.fill(length)(sc.nextInt())

    val hasDuplicateValue = input.sorted
      .foldLeft((false, 0)) { (memo, value) =>
        val ans = if (memo._1) {
          true
        } else {
          memo._2 == value
        }
        (ans, value)
      }
      ._1

    val ans = if (hasDuplicateValue) "NO" else "YES"
    println(ans)
  }
}
