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: Time Limit Exceeded

Solution code:
N = int(input())

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

for num in nums:
    if nums.count(num) >= 2:
        print("NO")
        break
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
flag = True
b = []
for i in a:
    if b.count(i) != 0:
        flag = False
        break
    b.append(i)

if flag == True:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

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

is_distinct = False
for i in range(n):
  for j in range(i+1, n):
    if A[i] == A[j]:
      is_distinct = True
      break

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i,b in enumerate(a):
    for j in range(i+1,n):
        #print(b,a[j])
        if b == a[j]:
            print('NO')
            exit()
print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [0 for _ in range(max(a)+1)]
for i in range(n):
  if l[a[i]] == 0:
    l[a[i]] += 1
  else:
    print('NO')
    break
else:
  print('YES')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
check = True
for i in range(n):
    if l.count(l[i]) > 1:
        check = False
        break
if check:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
dic = {}
flag = 1
for i in range(n):
    if a[i] in dic.keys():
        flag = 0
        print("NO")
        break
    else:
        dic[a[i]] = 1
if flag:
    print("YES")

Submission status: Time Limit Exceeded

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

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

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 = set(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
lst = list(map(int,input().split()))

lst.sort()
for i in range(n-1):
  if lst[i] == lst[i+1]:
    print('NO')
    sys.exit()
print('YES')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = list(input().split())
c = collections.Counter(a)

if c.most_common()[0][1] != 1:
    print('NO')
    exit()

print('YES')

Submission status: Accepted

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

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 N == len(set(A)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
ls = input().split(' ')
dic = { i for i in ls }
if len(dic) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = "YES"

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
ans = 'YES' if len(A) - len(set(A)) == 0 else 'NO'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A_ls = input().split(' ')
A_set = { i for i in A_ls }
if len(A_set) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A_ls = map(int, input().split(' '))
rst = { i for i in A_ls }
if len(rst) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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


x = len(set(a))


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

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()
for i in range(N-1):
    if A[i]==A[i+1]:
        print("NO")
        break
    if i==N-2:
        print("YES")

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
A=list(map(int, input().split()))

cnt=Counter(A)
print("YES" if all([i==1 for i in cnt.values()]) else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
alist = list(map(int,input().split()))
if len(set(alist))==n:
  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(n-1):
    if a[i] == a[i+1]:
        ans = 'NO'    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A_ls = list(input().split(' '))
rst = { i for i in A_ls }
if len(rst) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

A_set = set(A)

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

Submission status: Accepted

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

A_set = set(A)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1,N):
    if A[i] == A[i-1]:
        print("NO")
        Flag = False
        break
    else:
        Flag = True

if Flag:
    print("YES")

Submission status: Accepted

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

from collections import Counter

c = Counter(a)

for i, v in c.items():
    if v >= 2:
        re += 1

if re >= 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(a)
new = c.values()

for i in new:
    if i > 1:
        re += 1

if re > 0:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(a)
new = c.values()

for i in new:
    if i != 1:
        re = "NO"
        break
    else:
        re = "YES"

print(re)

Submission status: Accepted

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

A = list(set(A))

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

Submission status: Accepted

Solution code:
import copy

N = int(input())
list1 = list(map(int, input().split()))
list2 = copy.copy(list1)
list3 = set(list1)



x=len(list2)
y=len(list3)


if x==y:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A_ls = list(input().split(' '))
A_set = { i for i in A_ls }
if len(A_set) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = int(input())
table = list(map(int, input().split()))
count = 0
list.sort(table)
if num == 2:
        if table[0] == table[1]:
            count += 1
else:
    for i in range(1, num-1):
        if num == 2:
            if table[0] == table[1]:
                count += 1
        elif table[i] == table[i+1] or table[i-1] == table[i]:
            count += 1
        else:
            continue
if count == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    A.sort()
    flag=1
    for i in range(N-1):
        if A[i]==A[i+1]:
            flag=0
            break
        
    if flag:
        print("YES")
    else:
        print("NO")

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int,input().split()))
x = len(lst)
lst = list(set(lst))
y = len(lst)

if (x == y):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
def main():
     N = I()
     A = LI()
     c = Counter(A)
     if len(c.values()) == N:
         print('YES')
     else:
         print('NO')
if __name__ == "__main__":
    main()

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:
from collections import Counter
N=int(input())
Alist=list(map(int,input().split()))
count=Counter(Alist)
flag=True
for value in count.values():
    if value>1:
        flag=False
print('YES' if flag else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = sorted(a)
memo = 0
for i in range(n-1):
  if(b[i]==b[i+1]):
    memo +=1
if(memo==0):
  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("NO")
else:
  print("YES")

Submission status: Accepted

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

for x in range(n-1):
  if an[x+1]-an[x] == 0:
    print("NO")
    break

else:
  print("YES")

Submission status: Accepted

Solution code:
import sys

n = int(input())
a = dict()
for x in map(int, input().split()):
  if a.get(x) == 1:
    print('NO')
    sys.exit()

  a[x] = 1

print('YES')

Submission status: Accepted

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

s=set()
for i in range(N):
  s.add(A[i])
  
if len(s)==N:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

C = collections.Counter(A)

V = C.values()
L = list(V)


for i in range(len(L)):
    if L[i] > 1:
        print('NO')
        exit()
        
print('YES')

Submission status: Accepted

Solution code:
N=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
#e1,e2 = map(int,input().split())
A = list(map(int,input().split()))
#j = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
A.sort()
ans="YES"
for i in range(1,N):
    if A[i-1]==A[i]:
        ans="NO"
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
c = []
res = "YES"
for i in range(n):
  c.append(a[i])
c = set(c)
if len(c) != n:
  res = "NO"
print(res)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = sorted([int(i) for i in input().split()])
ans = 'YES'
for i in range(1, n):
  if a[i-1] == a[i]:
    ans = 'NO'
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,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())
A = {i for i in input().split()}
print("YES" if N==len(A) else "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:
s=int(input())
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
a = list(map(int,input().split()))
#b = list(map(int,input().split()))

c = {i for i in a}  

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

Submission status: Accepted

Solution code:
N = int(input())
A_ls = input().split(' ')
rst = { i for i in A_ls }
if N == len(rst):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = {a for a in input().split()}
if len(A) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
def main():
    n = int(input())
    a = list(map(int, input().split(" ")))
    d = defaultdict(lambda:0)
    for i in range(n):
        d[a[i]] += 1
    if max(d.values()) >1:
        print("NO")
    else:
        print("YES")
        
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(a)
d = sorted(list(c.values()))
print('YES' if d[-1] == 1 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
As = [int(a) for a in input().split()]

a_uniq = set(As)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
B = set(A)
b = len(B)

if N == b:
    print('YES')
else:
    print('NO')

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:
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7
    N = II()
    A = LMIIS()
    print('YES' if len(A) == len(set(A)) else 'NO')

    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import heapq
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
bef = a[0]
for i in range(1,n):
    if bef == a[i]:
        print("NO")
        break
    bef = a[i]
    if i == n-1:
        print("YES")

Submission status: Accepted

Solution code:
def check(seq):
    return len(seq) != len(set(seq))

def main():
  N = int(input())
  A = list(map(int, input().split()))
  ans = check(A)
  if ans:
    print("NO")
  else:
    print("YES")
main()

Submission status: Accepted

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

for i in A:
    if i in d:
        print("NO")
        exit(0)
    else:
        d[i] = 1

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:
m = input()
N = list(map(int, input().split(' ')))
# m = int(input())
# k = int(input())
c = 0
N.sort()
for i in range(len(N)-1):
    if N[i] == N[i+1]:
        print('NO')
        exit()

print('YES')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(len(li)):
  if li[i]>1:
    print('NO')
    exit()
print('YES')

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のどの2つの要素も互いに異なること ⇔ 重複しない要素の個数がN
# 上記の事実を用いずに考えると・・・N=10^5なので、O(N)で解く
# 二重ループはO(N^2)なので間に合わない
 
# 数列に等しい値がある場合、ソートしたとき、隣接する場所に値が集まる
# まずソートし、全ての隣接する2項を比較すればよい
A = sorted(A)
 
ans = 'YES'
for i in range(N-1):
  if A[i] == A[i+1]:
    ans = 'NO'
    break
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = sorted([int(i) for i in input().split()])
for i, v in enumerate(s[0:-1]):
	if v == s[i+1]:
		print('NO')
		exit()
print('YES')

Submission status: Accepted

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

M = {}
result = 'YES'
for a in A:
    if a in M.keys():
        result = 'NO'
    M[a] = a

print(result)

Submission status: Accepted

Solution code:
import os, sys, re, math

N = int(input())
A = [int(n) for n in input().split()]

A = sorted(A)
answer = 'YES'
for i in range(1, len(A)):
    if A[i - 1] == A[i]:
        answer = 'NO'
        break

print(answer)

Submission status: Accepted

Solution code:
d = {}
n = input()
aaa = list(map(int, input().split(' ')))
ans = 'YES'
for a in aaa:
  d[a] = d.get(a, 0) + 1
  if d[a] >= 2:
    ans = 'NO'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
st = set()
n = int(input())
ls = [int(x) for x in input().split()]
for i in ls:
  st.add(i)
  
if len(st) == n:
  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("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

A_list = list(map(int, input().split()))
A_list_min = sorted(A_list)

for i in range(len(A_list)-1):
    if A_list_min[i] == A_list_min[i+1]:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

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

if N == len(set(A)): 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:
n = int(input())
a = set(input().split())
if len(a) == n:
  print("YES")
else:
  print("NO")

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:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    S = set(A)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [ int(a) for a in input().split()]
    A_ = set(A)
    if len(A)==len(A_):
        print("YES")
    else:
        print("NO")
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n=int(input())
x=list(map(int,input().split()))
x.sort()

for i in range(n-1):
    if x[i]==x[i+1]:
        print('NO')
        sys.exit()
        
print('YES')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
s=set(input().split())
if len(s)==n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    a_list.sort()
    flag = True

    for i in range(n - 1):
        if a_list[i] == a_list[i + 1]:
            flag = False
            break

    if flag:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    a_set = set(a_list)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

N=int(input())
A=list(map(int,input().split()))
if has_duplicates(A):
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
import collections 
n = int(input())
a = map(int,input().split())
c = collections.Counter(a)
c = c.values()
for i in c:
  if i!=1:
    print("NO")
    exit()
print("YES")

Submission status: Accepted

Solution code:
n= int(input())
che={}
ans='YES'
a = list(map(int, input().split()))
for i in a:
  if i in che.keys():
    ans='NO'
  else:
    che[i]=0
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
dic=Counter(a)
for val in dic.values():
    if val>=2:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

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

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

Submission status: Accepted

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

if len(set(p)) == len(p):
	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(1,n):
  if(a[i-1]==a[i]):
    ans = "NO"
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, 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())
A = list(map(int, input().split()))
N_MAX = 200000
A_MAX = 10 ** 9

temp = dict()

for i in A:
  if i in temp:
    print("NO")
    exit()
  else:
    temp[i] = 0
print("YES")

Submission status: Accepted

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

m = set(A)
M = len(m)

if N == M:
  print("YES")
  
else:
  print('NO')

Submission status: Accepted

Solution code:
N=int(input())
A=input().split()
S={}
for a in A:
  if a in S.keys():
    print('NO')
    break
  S[a]=1
else:
  print('YES')

Submission status: Accepted

Solution code:
import sys

N = int(input())
A = sorted(list(map(int, input().split())))
pre = None
for a in A:
    if a == pre:
        print('NO')
        sys.exit()
    pre = a

print('YES')

Submission status: Accepted

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

abc154c_distinct_or_not()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
sort_A = sorted(A)
str_A = list(map(str, sort_A))
o = 'YES'
for i in range(1, len(A)):
	if str_A[i-1] == str_A[i]:
		o = 'NO'
		break
print(o)

Submission status: Accepted

Solution code:
#import math
import collections
#n,k = map(int, input().split( ))
#A = list(map(int, input().split( )))
n = int(input())
A = list(map(int, input().split( )))
c = collections.Counter(A)

a = c.most_common()[0][1]
if a != 1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N=int(input())

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

S=set()
for i in A:
    S.add(i)

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

Submission status: Accepted

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

A = set(A)

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n = ini()
a = inl()
print("YES" if n == len(set(a)) else "NO")

Submission status: Accepted

Solution code:
n = int(input())
alst = list(map(int, input().split()))
alst.sort()
bef = -1
for a in alst:
    if bef == a:
        print("NO")
        break
    bef = a
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
d = set()
for x in a:
  if x in d:
    print("NO")
    quit()
  d.add(x)
print("YES")

Submission status: Accepted

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