import Foundation

extension Array where Element: Equatable {
    mutating func remove(value: Element) {
        if let i = self.indexOf(value) {
//        if let i = self.firstIndex(of: value) {
            self.removeAtIndex(i)
        }
    }
}

let N = Int(readLine()!)!
//var array =  [1,1,1]
var array =  readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
var answer = "YES"
_ = array.map {
    //array.remove(value: $0)
	if let i = array.indexOf($0) {
        array.removeAtIndex(i)
    }
    if array.contains($0) {
        answer = "NO"
    }
}
print(answer)