Problem:
Score : 300 points

Problem Statement

Given is a sequence of integers A_1, A_2, ..., A_N.
If its elements are pairwise distinct, print YES; otherwise, print NO.

Constraints

2 ≤ N ≤ 200000

1 ≤ A_i ≤ 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A_1 ... A_N

Output

If the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.

Sample Input 1

5
2 6 1 4 5

Sample Output 1

YES

The elements are pairwise distinct.

Sample Input 2

6
4 1 3 1 6 2

Sample Output 2

NO

The second and fourth elements are identical.

Sample Input 3

2
10000000 10000000

Sample Output 3

NO

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

namespace AtCoderCS
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Text;
    using System.Linq;
    using static System.Console;
    using static System.Math;
    using static Macro;
    using static Ex;
    using static Library;

    class Program
    {
        void Solve()
        {
            var N = IN.Int;
            var A = new int [N];
            REP(N, i => A[i] = IN.Int);
            
            (A.Length == A.Distinct().Count())
                .Yn("YES", "NO")
                .Print();
            
        }

        private SimpleInput IN = new SimpleInput();
        private SimpleOutput OUT = new SimpleOutput();

        void Stream()
        {
            Solve();
            OUT.Flush();
        }

        static void Main(string[] args)
            => new Program().Stream();
    }


    #region IO

    class SimpleInput
    {
        private string[] _nextBuffer;
        private int _bufferCnt;
        private readonly char[] _cs = new char[] {' ', '"', ','};

        public SimpleInput()
        {
            _nextBuffer = new string[0];
            _bufferCnt = 0;
        }

        string Next()
        {
            if (_bufferCnt < _nextBuffer.Length) return _nextBuffer[_bufferCnt++];
            var st = ReadLine();
            while (st == string.Empty) st = ReadLine();
            if (st != null) _nextBuffer = st.Split(_cs, StringSplitOptions.RemoveEmptyEntries);
            _bufferCnt = 0;
            return _nextBuffer[_bufferCnt++];
        }

        public string String => Next();
        public char Char => char.Parse(String);
        public int Int => int.Parse(String);
        public long Long => long.Parse(String);
        public double Double => double.Parse(String);
    }

    class SimpleOutput
    {
        private readonly StreamWriter _sw = new StreamWriter(OpenStandardOutput())
        {
#if DEBUG
            AutoFlush = true
#else
            AutoFlush = false
#endif
        };

        public SimpleOutput()
        {
            SetOut(_sw);
        }

        public void Flush() => Out.Flush();
    }

    #endregion

    #region MACRO

    static class Macro
    {
        public static void FOR(int a, int b, int n, Action<int> f)
        {
            for (int i = a; i < b; i += n) f(i);
        }

        public static void FOR(int a, int b, Action<int> f) => FOR(a, b, 1, f);
        public static void REP(int a, Action<int> f) => FOR(0, a, f);
    }

    #endregion

    #region Ex

    static class Ex
    {
        public static string AsString(this IEnumerable<char> xs) => new string(xs.ToArray());
        public static void Print<T>(this T x) => WriteLine(x);
        public static string Yn(this bool x, string y = "Yes", string n = "No") => x ? y : n;
    }
    #endregion
    
    #region Library

    static class Library
    {
        public static int BinarySearch(int ng, int ok, Func<int, bool> f)
        {
            while (Math.Abs(ok - ng) > 1)
            {
                var mid = (ok + ng) / 2;
                if (f(mid)) ok = mid;
                else ng = mid;
            }

            return ok;
        }

        public static int LowerBound<T>(IReadOnlyList<T> a, T x) where T : IComparable<T> =>
            BinarySearch(-1, a.Count, (m) => a[m].CompareTo(x) >= 0);

        public static int UpperBound<T>(IReadOnlyList<T> a, T x) where T : IComparable<T> =>
            BinarySearch(-1, a.Count(), (m) => a[m].CompareTo(x) > 0);
    }

    #endregion
}