"use strict";
main(
  require("fs")
    .readFileSync("/dev/stdin", "UTF-8")
    .trim()
    .split("\n")
);

function main(input) {
  let test = input[1].split(" ").filter((x, i, self) => self.indexOf(x) === i);
  console.log(
    test.toString() === input[1].split(" ").toString() ? "YES" : "NO"
  );
}
