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



Sample input:
5
2 6 1 4 5


Sample output:
YES

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().strip().split(" ")))
if len(list(set(a)))==n:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
flag = True
for idx, i in enumerate(a[:-1]):
    if i == a[idx+1]:
        print('NO')
        flag= False
        break
if flag:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

aset = set()

for elm in a:
    aset.add(elm)

if len(aset) == n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys
n = int(input())
s = list(map(int, input().split()))
s.sort()
k = 0
for i in s:
    if i == k:
        print('NO')
        sys.exit()
    k = i
print('YES')

Submission status: Accepted

Solution code:
n = input()
a = input().split(' ')
if len(a) == len(set(a)):
    print("YES")
else :
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
print("YES" if len(a_list) == len(set(a_list)) else "NO")

Submission status: Accepted

Solution code:
# C - Distinct or Not
def main():
    N, *A = map(int, open(0).read().split())
    print("YES" if len(set(A)) == N else "NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = input().split(' ')
 
if len(set(a)) == n:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
if len(set(A)) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
_,*a=open(0).read().split();print("YNEOS"[sorted(a)!=sorted(set(a))::2])

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int,input().split()))

if len(A) != len(set(A)):
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
A.sort()
for i in range(1,n):
    if A[i-1]==A[i]:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = set(map(int, input().split()))

if len(A) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(int,input().split()))
f=sorted(list(s))
d=set(s)
if(len(s)==len(d)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
U = set()
for i in input().split():
    U.add(i)
print('YES' if len(U) == N else 'NO')

Submission status: Accepted

Solution code:
import sys

N = int(input())
A_i = list(map(int, input().split()))
A_i = [i for i in A_i if 1 <= i and i <= 10**9]

if not 2 <= N or not N <= 2*10**5:
    print("error:N")
    sys.exit()
if len(A_i) != N:
    print("error")
    sys.exit()

if len(list(set(A_i))) == len(A_i):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 'YES'
for i in range(0, N - 1):
    if A[i] == A[i + 1]:
        ans = 'NO'
        break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
A = sorted(A)
for i in range(N-1):
  if A[i] == A[i+1]:
    print("NO")
    exit()
print("YES")

Submission status: Accepted

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
s = set(l)

print("YES" if len(s) == len(l) else "NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

if len(set(A)) == len(A):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
num = int(input())
print('YES' if len(set([int(i) for i in input().split()])) == num else 'NO')

Submission status: Accepted

Solution code:
s=int(input())
t=list(map(int,input().split()))
t.sort()
a=0
for i in range(len(t)-1):
  if t[i]==t[i+1]:
    a=1
    break
if a==1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
s=int(input())
t=list(map(int,input().split()))
t.sort()
u=set(t)
a=len(t)
b=len(u)
if a!=b:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
S = set()
input()
for a in map(int, input().split()):
  if a in S:
    print("NO")
    exit()
  else:
    S.add(a)
print("YES")

Submission status: Accepted

Solution code:
import collections
n=int(input())
lists=list(map(int,input().split()))
D=dict(collections.Counter(lists)).values()
if sum(D)==len(D):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
now = set()
for i in a:
    now.add(i)
if len(now) == n:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
A = Counter(list(map(int, input().split())))
ans = "YES"
for k, v in A.items():
  if v > 1:
    print("NO")
    exit()
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split(' ')))

is_break = False
seen = set()
for a in A:
    if a not in seen:
        seen.add(a)
    else:
        is_break=True
        break

if is_break:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = set(a)
if len(a) == len(b):
	print ("YES")
else:
	print ("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, A: "List[int]"):
    if N == len(set(A)):
        return YES
    else:
        return NO


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, A))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
A = input().split()
n = len(A)
n_temp = len(set(A))

if n != n_temp:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
def pairwise_distinct():
    n = int(input())
    k = list(input().split()) #input based on n
    if not len(k) == n:
        return "==== pleas input based on n times in one line ===="
    else:
        if (len(set(k)) == len(k)):
            return "YES"
        else:
            return "NO"

print(pairwise_distinct())

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = list(set(a))

if len(a) == len(s):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
length=input()
#len-1
Narray=sorted(input().split())
n=0
while n<int(length)-1:
	if Narray[n] == Narray[n+1]:
		print("NO")
		break
	elif n==int(length)-2:
		print("YES")
		break
	else:
		n+=1

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

b = set(a)
Flag = (len(a) == len(b))
if Flag:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
*A, = map(int, input().split())
s = set(A)
if len(s) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def pairwise_distinct():
    n = int(input())
    k = list(input().split())
    if (len(set(k)) == len(k)):
        return "YES"
    else:
        return "NO"

print(pairwise_distinct())

Submission status: Accepted

Solution code:
n=input()
nums=list(map(int, input().split()))
nums.sort()
res = True
prev = None
for i in nums:
    if i == prev:
        res = False
    else:
        prev = i
if res:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))

ans ="YES" if len(set(A))==N else "NO"

print(ans)

Submission status: Accepted

Solution code:
# C
import numpy as np
import itertools
N = int(input())
A = list(map(int,input().split()))

A.sort()

list_tmp=[ A[i+1]-A[i] for i in range(N-1)]

if 0 in list_tmp:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n,a=open(0);print('YNEOS'[int(n)>len(set(a.split()))::2])

Submission status: Accepted

Solution code:
N = int(input())
List = sorted(list(map(int, input().split())))
for i in range(N-1):
  if List[i] == List[i + 1]:
    print("NO")
    break
else:
  print("YES")

Submission status: Accepted

Solution code:
n = int(input())
s = len(set(input().split()))
if n == s:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
for i in range(n-1):
    if a[i] == a[i + 1]:
        print("NO")
        break
    count += 1
if count == n - 1:
    print("YES")

Submission status: Accepted

Solution code:
import sys

N = sys.stdin.readline().strip()
a = [int(x) for x in sys.stdin.readline().strip().split(" ")]

m = {}
for n in a:
    if not n in m:
        m[n] = 1
    else:
        print("NO")
        break
else:
    print("YES")

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
a=len(L)
c=len(set(L))
if a==c:
    print('YES')
else:print('NO')

Submission status: Accepted

Solution code:
def has_duplicates(seq):
    return len(seq) == len(set(seq))


iranai  =input()
l   =   input()
aa  =   l.split(sep=" ")
if has_duplicates(aa):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = input()
a = input().split()
n = int(n)
a = [int(s) for s in a]
a.sort()
#print(a)
s=0

for i in range(len(a)-1):
    #print(a[i],a[i+1])
    
    if a[i]==a[i+1]:
        print("NO")
        s=s+1
        break
        
if s == 0: print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = set(a)
if len(s) == n:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

A.sort()

for i in range(N - 1):
    if A[i] == A[i + 1]:
        print('NO')
        break
else:
    print('YES')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    StringN = input();
    listA = input().split();
    listA.sort();
#    newlistA = sorted(listA);
#    print(newlistA);

    for i in range(int(StringN)-1):
#        print(newlistA[i]);
#        print(newlistA[i+1]);
        if listA[i] == listA[i+1]:
            print('NO');
#            print (i)
            return 0;
    print('YES');


main();

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
for i in range(n-1):
    if l[i]==l[i+1]:
        print('NO')
        exit()
print('YES')

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = list(map(int,input().split()))
i=0
a.sort()
while(i<n-1):
  if(a[i] == a[i+1]):
    print("NO")
    sys.exit()
  i += 1
print("YES")

Submission status: Accepted

Solution code:
N  = int(input())
A = list(map(int, input().split()))
A.sort()

r = True
for i in range(N-1):
    if A[i] == A[i+1]:
        r = False

if r:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
dictionary = {}
for i in range(n):
    if a[i] in dictionary:
        dictionary[a[i]] += 1
        if 2 <= dictionary[a[i]]:
            print("NO")
            exit()
    else:
        dictionary[a[i]] = 1
print("YES")

Submission status: Accepted

Solution code:
from collections import defaultdict

def main():
    N = int(input())
    a = list(map(int, input().split()))
    dct = defaultdict(int)

    for i in a:
        if dct[i] != 0:
            print("NO")
            return 
        else:
            dct[i] += 1
    
    print("YES")
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
list = input().split()
 
int_list = [ int(n) for n in list ]
int_list.sort()

isDist = True
 
for a in range(n-1):
  if int_list[a] == int_list[a+1]:
    print("NO")
    isDist = False
    break;
 
if isDist is True:
    print("YES")

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = list(map(int,input().split()))
'''
for num in a:
  i = a.index(num)
  if(num in a[i+1:]):
    print("NO")
    sys.exit()
print("YES")
'''

i=0
a.sort()
while(i<n-1):
  if(a[i] == a[i+1]):
    print("NO")
    sys.exit()
  i += 1
print("YES")

Submission status: Accepted

Solution code:
import sys
from collections import *
from heapq import *
from fractions import gcd
import itertools
import math
import numpy as np

sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, input().split(' ')))
def In(): return int(input())
def InS(): return input()


N = In()
S = set(InMap())
print("YES" if N == len(S) else "NO")

Submission status: Accepted

Solution code:
n = int(input())
a = map(int, input().split())

print('YNEOS'[len(set(a))!=n::2])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
flag = 0

for j in range(len(a)):
  if a[j-1] == a[j]:
    print('NO')
    flag = 0
    break
  else:
    flag = 1
    pass
  
if flag == 1:
  print('YES')

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read

N, *A = map(int, read().split())
if len(set(A)) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
import math
import itertools
N=int(input())
A=list(map(int,input().split()))
A.sort()
flag=True
for i in range(len(A)-1):
    if A[i]==A[i+1]:
        flag=False
if flag==True:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A_list = list(map(int, input().split()))
A_list_len = len(A_list)

A_set = set(A_list)
A_set_len = len(A_set)

if int(A_list_len) == int(A_set_len):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    N, *A = map(int,read().split())
    d = defaultdict(int)
    for a in A:
        d[a] +=1
    if len(A)==len(d):
        result = 'YES'
    else:
        result = 'NO'

    return result

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
print("YES" if len(Counter(list(map(int,input().split()))).keys())==N else "NO")

Submission status: Accepted

Solution code:
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)
Z = len(M)
if Y == Z:
    print("YES")

else:
    print("NO")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc154/submissions/10004289

N=int(input())
A=list(map(int, input().split()))
B=sorted(A)


answer="YES"
for i in range(N-1):
  if B[i]==B[i+1]:
    answer="NO"
    break
    
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int,input().split()))

if len(s) == len(set(s)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
d={}
flag=True
for i in range(n):
    try:
        if d[a[i]]==1:
            print('NO')
            flag=False
            break
    except:
        d[a[i]]=1

if flag:
    print('YES')

Submission status: Accepted

Solution code:
N = int(input())
list = list(map(int, input().split()))



if ((len(list)) == (len(set(list)))) == True:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
nums = [int(x) for x in input().strip().split()]
ret = "YES" if len(set(nums)) == len(nums) else "NO"
print(ret)

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
ans = 'YES'
x = c.values()
if not len(x) == n:
	ans = 'NO'
print(ans)

Submission status: Accepted

Solution code:
def main():
	n=int(input())
	a=list(map(int, input().split()))
	a.sort()
	c=0
	for i in range(n-1):
		if a[i] == a[i+1]:
			print('NO')
			c+=1
			break
	if c==0:
		print('YES')
main()

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = list(map(int, input().split()))
A2 = sorted(A)
for i in range(N-1): 
        if A2[i] == A2[i+1]: 
            print("NO")
            sys.exit()
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int( input() )
a = list( map( int, input().split() ) )
 
if len(a) == len(set( a )):
  print( "YES" )
else:
  print( "NO" )

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort()
flag = 0

for i in range(n-1):
  if a[i] == a[i+1]:
    flag = 1
    break
    
if flag == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())

def checkIfDuplicates(listOfElems):
    if len(listOfElems) == len(set(listOfElems)):
        return False
    else:
        return True

listOfElems = list(map(int, input().split()))
result = checkIfDuplicates(listOfElems)
if result:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
A=input()
B=list(map(int,input().split()))
B.sort()
num=0
for i in range(len(B)-1):
  if B[i]==B[i+1]:
    num=1
if num==1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N = int(input())
list = list(map(int, input().split()))



if ((len(list)) == (len(set(list)))) == True:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))
flag = 0
lst.sort()
for i in range(n-1):
  if lst[i] == lst[i+1]:
    print('NO')
    flag = 1
    break
if flag == 0:
  print('YES')

Submission status: Accepted

Solution code:

# input_first= 5
# input_second=[2,6,1,4,5] 
input_first = input()
input_second= input().split()
N = int(input_first)
in_list = [int(i) for i in input_second]


check_dic = {}
flag  =0
for i in in_list:
    if i in check_dic.keys():
        # print(i)
        print("NO")
        flag = 1
        break
    else:
        check_dic[i] = True
    

# print(check_dic)
if flag ==0:
    print("YES")

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = input().split()
A1 = Counter(A)
A2 = A1.most_common()[0]
A3 = list(A2)
if A3[1] == 1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=input()
i = list(map(int, input().split()))
b=len(list(set(i)))
c=len(i)
ans=("YES" if c == b else "NO")
print(ans)

Submission status: Accepted

Solution code:
num = int(input())
nums = input().split()

if len(set(nums)) == num:
	print('YES')
else:
	print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int( input() )
a = set( map( int, input().split() ) )

if n == len(a):
  ans = "YES"
else:
  ans = "NO"

print( ans )

Submission status: Accepted

Solution code:
a = int(input());s = set(i for i in map(int,input().split()))
print('YES' if len(s)==a else 'NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
count = 0

A = sorted(A)

for i in range(N-1):
    if A[i] == A[i+1]:
        count += 1
            
if count == 0:
    print("YES")
    
else:
    print("NO")

Submission status: Accepted

Solution code:
l = [input().split() for l in range(2)]
#print(l)
Al = l[1]

if len(Al) == len(set(Al)):
  print("YES")
else :
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

if len(A) != len(set(A)):
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
aa = input()
l = aa.split()
for i in range(0,n):
    l[i] = int(l[i])
l.sort()
count = 0
for i in range(0,n-1):
    if l[i] == l[i+1]:
        count = count+1
if count == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = input().split(" ")
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N = input()
input_line = input()
Ai = input_line.split(" ")
NumAi = np.array(Ai)
Comment = "NO"
N = int(N)
if(len(NumAi) == len(np.unique(NumAi))):
  Comment = "YES"

#if(NumAi != set)
      
print(Comment)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))

def has_duplicates(seq):
    return len(seq) != len(set(seq))

if(has_duplicates(L) == False):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
flag=False
for i in range(1,N):
    if A[i-1]==A[i]:
        flag=True
if flag:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
if len(set(A))==N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 無限 #####
# f_inf = float('inf')

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	A = inputList()

	A.sort()

	for i,val in enumerate(A):
		if i == 0:
			continue
		if val == A[i-1]:
			print("NO")
			sys.exit()

	print("YES")

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
A = set(input().split(" "))
if len(A) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
s = input()
a = map(int, input().lower().split())
 
if int(s) == len(set(a)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

def func1():
    S = set()
    for i in range(N):
        if A[i] in S:
            return False
        S.add(A[i])
    return True

if func1():
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = [int(e) for e in input().split()]
if len(A) == len(list(set(A))):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())

A = list(map(int, input().split()))
A.sort()
flag = True
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = False
if flag == True:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n = input()
a = map(int, raw_input().strip().split())
s = list(set(a))

if len(s) != n:
    print "NO"
else:
    print "YES"

Submission status: Accepted

Solution code:
n = int(input())

a = list(map(int, input().split()))

a.sort()

count = 0

for i in range(n-1):
    if a[i] == a[i+1]:
        count += 1

if count == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
str = input()
nums = input().split()
num_set = set(nums)

if len(num_set)==int(str):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
nums = sorted(list(map(int, input().split())))
m = 0
for i in range(n-1):
  if nums[i] < nums[i+1]:
    m += 1
if m == n-1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
def func():
    return

n = int(input())
# s = input()
# a, b = map(int, input().split())
a = list(map(int, input().split()))
# a = input().split()

ascA = sorted(a)
for i in range(n-1):
    if ascA[i] == ascA[i+1]:
        print("NO")
        exit()

'''
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            print("NO")
            exit()
'''
'''
ans = [0]*(max(a)+1)
for ida in a:
    if ans[ida] > 0:
        print("NO")
        exit()
    ans[ida] += 1
'''

print("YES")

Submission status: Accepted

Solution code:
# 入力
n = int(input())
a_list = list(map(int, input().split()))


def has_duplicates(seq):
    return len(seq) != len(set(seq))


if has_duplicates(a_list):
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
S = set(A)
if len(S)==len(A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())

A = list(map(int, input().split())) 

di={}


for i in range(N):
    di[A[i]] = i 

if len(di)<len(A):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort()
b = False
for i in range(n-1):
    if(a[i-1] == a[i]):
        print("NO")
        b = True
        break

if(not b):
    print("YES")

Submission status: Accepted

Solution code:


n = int(input())
a = list(map(int, input().split()))

print('YES' if len(set(a)) == len(a) else 'NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
flag = False

for i in range(N-1):
    if A[i]==A[i+1]:
        flag=True
        break
if flag:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = set(A)
if len(B)==len(A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort()

flag = False
for i in range(1,n):
    if a[i] == a[i-1]:
        flag = True
    
if flag:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
import collections
a=input()
a=int(a)
b=input().split()
c = collections.Counter(b)
        
if (len(c)==a):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = input()
l = input().split(" ")
s = set(l)

if len(s) == len(l):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n=input()
li = list(map(int,input().split()))
a=len(li)
b=len(set(li))
if a == b:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=list(set(a))
if len(a)==len(b):
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
s = input()
a = map(int, input().lower().split())

if int(s) == len(set(a)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
P = list(map(int,input().split()))
def has_duplicates(seq):
    return str(len(seq) != len(set(seq)))
if has_duplicates(P) == 'False':
  print('YES')
elif has_duplicates(P) == 'True':
  print('NO')

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))
B=sorted(A)


answer="YES"
for i in range(N-1):
  if B[i]==B[i+1]:
    answer="NO"
    
print(answer)

Submission status: Accepted

Solution code:
import  collections
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    c = collections.Counter(A)
    C = max(c.values())
    if C > 1 :
        print('NO')
    else:
        print('YES')
resolve()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = set(a)
if len(a) == len(b):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
set = int(input())
 
lis = list(map(int, input().split()))
 
v = 0
lis.sort()

for i in range(set-1):
    if lis[i] == lis[i + 1]:
        v =1
            
if v == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
input()
array = input().split()

if len(set(array)) == len(array):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())

s = input().split(" ")

b = len(s)

s = set(s)

a = len(s)



if a == b:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=set(a)

if n==len(s):
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
N = int(input())
array = list(map(int, input().split()))

array_num = len(array)
juhuku_num = len(list(set(array)))

if array_num == juhuku_num:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
arr = map(int,input().split())
if len(set(arr)) == n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))

a.sort()

for i in range(n-1):  
  if a[i] == a[i+1]:
    print("NO")
    exit()

print("YES")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
for i in range(1,N):
    if A[i]==A[i-1]:
        print("NO")
        break
else:
    print("YES")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = sorted(input().split())
    for i in range(N-1):
        if A[i]==A[i+1]:
            print("NO")
            return
    print("YES")
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
for i in range(n-1):
    if a[i] == a[i+1]:
        print("NO")
        exit()

print("YES")

Submission status: Accepted

Solution code:
n=int(input())
li=list(map(int, input().split()))
if n==len(set(li)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

ac = set(a)

if len(ac) == len(a):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = input()
x = list(map(int, input().split()))
s = set()
list(map(s.add, x))
if len(s) == len(x):
  print('YES')
else:
  print('NO')