let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  print_endline @@
  if
    ( = ) n @@
    List.length @@
    List.sort_uniq compare @@
    Array.to_list as_
  then "YES"
  else "NO"