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:
# -*- coding: utf-8 -*-

N = int(input())
A = list(input().split())
s = set()
for a in A:
    if a in s:
        print("NO")
        exit()
    s.add(a)
print("YES")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

a = sorted(a)
tmp = ""

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

print("YES")

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())
s=list(map(int,input().split()))
# N=6
# s=[4 ,1 ,3 ,1 ,6 ,2]


from collections import Counter
S=Counter(s)#カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})

if S.most_common(1)[0][1]==1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(e) for e in input().split()]
a.sort()
flag = False
for i in range(0,n-1):
    if a[i] == a[i+1]:
        flag = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

if len(set(A_list)) == 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'
        break
print(Ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def c():
    n = input()
    a = input().split()
    n2 = len(set(a))
    ans = ""
    if int(n) == n2:
        ans = "YES"
    else:
        ans = "NO"
    return ans
print(c())

Submission status: Accepted

Solution code:
#整数値入力 1文字の入力
def input_one_number():
    return int(input())

#整数値龍力　複数の入力(配列)
def input_multiple_number_as_list():
    return list(map(int, input().split()))


n = input_one_number()
asnyan = input_multiple_number_as_list()

asnyan.sort()

b = 0
flg = True
for a in asnyan:
    if b == a:
        flg = False
    b = a

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
al = list(map(int, input().split()))


d = set()
for a in al:
    if a in d:
        print("NO")
        exit()
    d.add(a)

print("YES")

Submission status: Accepted

Solution code:
# s = input().split()
s = int(input())
s2 = input().split()
i2 = 0


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


if has_duplicates(s2):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
    if (A[i] in dic) == True:
        print("NO")
        exit()
    dic[A[i]] = "exist"
print("YES")

Submission status: Accepted

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


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

Submission status: Accepted

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

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:
def duplication(seq):
    return len(seq) != len(set(seq))

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

if duplication(a) == True:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
a.sort()
ch=a.pop()
ans='YES'
for i in a:
  if ch == i:
    ans='NO'
    break
  else:
    ch=i
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

N = input().strip()
nums = map(int, input().strip().split())
cnts = Counter(nums)

flag = "YES"
for k, v in cnts.items():
  if v>1:
    flag = "NO"
    break
print(flag)

Submission status: Accepted

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

a_l = len(a)
test_l = len(set(a))

if (a_l == test_l):
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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 = input()

s = input().split()

target = {}
flag = 0


for i in s:
    if i in target:
        flag = 1
        break
    else:
        target[i] = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a_count = len(A)
a_uni_count = len(list(set(A)))

result = 'YES' if (a_count == a_uni_count) else 'NO'
print(result)

Submission status: Accepted

Solution code:
import sys

N = int(input())
d = list(map(int, input().split(" ")))

newList = list(dict.fromkeys(d))

if len(d) == len(newList):
  print('YES')
else:
  print("NO")

Submission status: Accepted

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

N_set = set(N_list)

list_num = len(N_list)
set_num = len(N_set)

if list_num==set_num:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

for a in A:
    if b == a:
        print('NO')
        exit()
    else:
        b = a
print('YES')

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
x = [int(x) for x in input().split()]
if N <= 1:
  print('YES')
elif 0 in np.diff(sorted(x)):
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

A.sort()
flag=0
for i in range(1,n):
    if A[i] == A[i-1]:
        flag=1
if flag==1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
i1 = input()
i2 = input()

i_sp = i2.split(' ')
len_i = len(i_sp)
set_i = set(i_sp)

if(len_i == len(set_i)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

alist = input().split()

checklist = {}

for ite in alist:
    if checklist.get(ite) == '1':
        print('NO')
        exit(0)
    else:
        checklist[ite] = '1'

print('YES')

Submission status: Accepted

Solution code:
# coding: utf-8
nl = int(input())
lst = list(map(int, input().split()))
st = set(lst)
ns = len(st)
if nl == ns:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = 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()))
k = set(a)
if len(k) == len(a):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

if i-len(set(W))==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
d = {}
for i in range(N):
    d.setdefault(A[i], i+1)
if len(d) == N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a_list = sorted(input().split(" "))

result = "YES"
prev = ""
for a in a_list:
    if a == prev:
        result = "NO"
        break
    prev = a

print(result)

Submission status: Accepted

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

xi.sort()
yesno="YES"
for i in range(n-1):
    if xi[i]==xi[i+1]:
        print("NO")
        yesno="NO"
        break    
if yesno=="YES":
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
li = [int(i) for i in 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()))

a1 = sorted(a)

for i in range(1, n):
  if a1[i] == a1[i-1]:
    print("NO")
    break
  elif i == n-1:
    print("YES")

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:
import sys
from io import StringIO
import unittest

def resolve():
    n=int(input())
    an = list(map(str,input().split()))

    d = {}

    for a in an:
        if a in d:
            print("NO")
            return
        d[a]  = 1

    print("YES")

    return

resolve()

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:
def resolve_C():
    n = input()
    s = input().split()
    if len(s) == len(set(s)):
        print("YES")
    else:
        print("NO")
resolve_C()

Submission status: Accepted

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

import collections
counter = collections.Counter(A)

for i in list(counter.values()):
    if not i == 1:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

B = sorted(A, reverse=True)
C = []
d = len(B)


for i in range(d-1):
  C.append(B[i]-B[i+1])
  
E = sorted(C)

if E[0] == 0:
  print("NO")
  
else:
  print("YES")

Submission status: Accepted

Solution code:
import collections

_ = input()
_list = input()
 
num_list = _list.split(' ')
 
c = collections.Counter(num_list)
if c.most_common()[0][1] > 1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
def Main(N, A):
    A.sort()
    for i in range(N):
        if(A[i] == A[i-1]):
            return "NO"
    return "YES"

def main():
    N = int(input())
    A = list(map(int, input().split()))
    print(Main(N, A))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import collections

N = int(input())
def search():
  arr = list(map(int, input().split()))
  count = collections.Counter(arr)
  for item in count.values():
    if item > 1:
      return 'NO'
  return 'YES'

res = search()
print(res)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
res = set()
ans = False
for i in a:
    if i in res:
        ans = True
    else:        
        res.add(i)
if ans ==True:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

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

print('NO' if has_duplicates(A) else 'YES')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num_len = len(num_list)
dict_len = len(list(set(num_list)))

if num_len == dict_len:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys
import math
n = int(input())
#s, t = map(str, input().split())
#a, b = map(int, input().split())
#s = input()
a = list(map(int, input().split()))

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

print("YES")

Submission status: Accepted

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

s = set()
flag = 0
for i in range(N):
    if num[i] in s:
        flag = 1
        break
    s.add(num[i])

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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = [int(a) for a in input().split()]

done = {}
flag = 0
for i in range(n):
  try:
    if done[a[i]] > 0:
      flag = 1
    done[a[i]] = 1
  except:
    done[a[i]] = 1

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().strip().split()))
ans = "YES"
dic = {}
for i in range(n):
    temp = str(a[i])
    if temp in dic:
        ans = "NO"
    else:
        dic[temp] = 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in 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:
N = int(input())
A = list(map(int, input().split()))
a = {}
for i in range(N):
  if A[i] in a:
    print('NO')
    exit()
  if not A[i] in a:
    a[A[i]] = True
print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def has_duplicates(arr):
    if len(arr) != len(set(arr)):
        return "NO"
    else:
        return "YES"


if __name__ == "__main__":
    n = int(input())
    arr = input().split()
    print(has_duplicates(arr))

Submission status: Accepted

Solution code:
#coding:utf-8
N = int(input())
A = set(map(int, input().split()))
if (N == len(A)):
    print ('YES')
else:
    print ('NO')

Submission status: Accepted

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

if len(l)==len(ll):
    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) == len(a):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
len_a = len(set(input().split()))

if N == len_a:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(len(l)):
    if i == 0:
        continue
    elif l[i]==l[i-1]:
        cnt+=1

if cnt == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = len(a)
y = len(set(a))

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split(" ")))
t = set(b)
bb = list(t)

if (len(b) == len(bb)):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
n = int(input())

l = [int(i) for i in input().split()]
del l[n:]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
n=int(s[0])
s = input().split()
dic={}
for i in s:
    dic[i]=1
if len(dic)==n:
    print('YES')
else:
    print("NO")

Submission status: Accepted

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

    if len(a) == n:
        print('YES')

    else:
        print('NO')

resolve()

Submission status: Accepted

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

answer = "YES"
memo = {}
for a in A:
    if memo.get(a) is None:
        memo[a] = 1
    else:
        memo[a] += 1
        answer = "NO"
        break

print(answer)

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

Submission status: Accepted

Solution code:
N, *A = map(int, open(0).read().split())

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

Submission status: Accepted

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

p=set(a)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

A = sorted(A)
sign = 0
for i in range(1,len(A)-1):
    if A[i-1] == A[i] or A[i] == A[i+1]:
        sign = 1

if N == 2 and A[0] == A[1]:
    sign = 1

if sign == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())

num_set = set(int(i) for i in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(x for x 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()
Check=0
for i in range(len(A)-1):
    if A[i+1]==A[i]:
        Check=Check+1
        break
if Check==0:
    print("YES")
else :
    print("NO")

Submission status: Accepted

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

def has_duplicated(seq):
    return len(seq) == len(set(seq))
if has_duplicated(A):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:

def MergeSort(arr):
    if len(arr) <= 1:
        return arr
    mid = len(arr) // 2
    left = arr[:mid]
    right = arr[mid:]
    left = MergeSort(left)
    right = MergeSort(right)
    return MergeArray(left, right)

def MergeArray(left, right):
    merged = []
    li, ri = 0, 0
    while li < len(left) and ri < len(right):
        if left[li] > right[ri]:
            merged.append(left[li])
            li += 1
        else:
            merged.append(right[ri])
            ri += 1
    if li < len(left):
        merged.extend(left[li:])
    elif ri < len(right):
        merged.extend(right[ri:])
    return merged

def solve():
    N = int(raw_input())
    A = [int(_) for _ in raw_input().split()]
    sortA = MergeSort(A)
    flag = True
    for i in range(N - 1):
        if sortA[i] == sortA[i+1]:
            flag = False
            break
    if flag:
        print 'YES'
    else:
        print 'NO'

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def has_duplicates(seq):
  if len(seq) != len(set(seq)):
    return "NO"
  else:
    return "YES"

N = int(input())

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

print(has_duplicates(seq))

Submission status: Accepted

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

A = sorted(A)
flag = True

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())
a=list(map(int,input().split()))
l=set(a)
if len(l)==len(a):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
cnt = {}
for a in A:
  if cnt.get(a):
    cnt[a] = cnt[a] + 1
  else:
    cnt[a] = 1
for v in cnt.values():
  if v != 1:
    print('NO')
    exit()
print('YES')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

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

dp = {}

for a in A:
    if a-2 in dp:
        print('NO')
        break
    dp[a-2] = 1
else:
    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=set(list(map(int, input().split())))
if N==len(A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import numpy as np

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

for i in range(1,len(A)):
    if a[i-1]==a[i]:
        print('NO')
        exit()

print('YES')

Submission status: Accepted

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

for i in range(1, len(a)):
    if a[i-1] == a[i]:
        print('NO')
        exit()

print('YES')

Submission status: Accepted

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

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

if has_duplicates(A) == False:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
import numpy as np

n = input()

a = input().split()

a_n = np.array(a)

if (len(a) == np.unique(a_n).size):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
an = map(int, input().split())

count = defaultdict(int)
for a in an:
    count[a] += 1
    if count[a] > 1:
        print('NO')
        exit()
print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = sorted(map(int,input().split()))
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 = list(map(int,input().split()))

a.sort()

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


if p == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import numpy as np
N=input()
A=list(map(int,input().split()))
A.sort()
D = np.array(A[1:len(A)]) - np.array(A[0:len(A)-1])
if sum(D == 0) >= 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
def solve():
    N, *A = map(int, open(0).read().split())
    
    A_set = set(A)
    if len(A_set) == N:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    solve()

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

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

Submission status: Accepted

Solution code:
s = 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:
import sys
input = sys.stdin.readline

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

len_a = len(a)
set_a = len(set(a))

if len_a == set_a:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])
    a = [int(e) for e in lines[1].split(' ')]

    return (n, a)


def solve(n, a):
    
    b = set()
    for e in a:
        b.add(e)

    result = 'NO'
    if len(a) == len(b):
        result = 'YES'

    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

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

a.sort();

ans = 1;

for i in range(1,n) :
	if a[i] == a[i-1] :
		ans = 0;

if ans :
	print('YES');
else :
	print('NO');

Submission status: Accepted

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

b=set(a)

if len(a)>len(b):
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N = int(input())
A = input().split(" ")
l1 = len(A)
Ax = set(A)
l2 = len(Ax)

if l1 == l2:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

A_set = list(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()))

B = sorted(A)
s = 0
for i in range(0,N-1):
    if B[i] == B[i+1]:
        s = s +1
if s > 0:
    print("NO")
else:
    print("YES")

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]"):
    ans = True
    prev_a = -1
    A.sort()
    for a in A:
        if a == prev_a:
            ans = False
        prev_a = a

    ans = YES if ans else NO
    print(ans)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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]"
    solve(N, A)

if __name__ == '__main__':
    main()

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 sys
sys.setrecursionlimit(10**9)
from collections import defaultdict

IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n=int(input())
mp=defaultdict(int)
a=list(IA())
flag=1
for it in a:
    if mp[it]==1:
        flag=0
    mp[it]=1
if flag==1:
    print("YES")
else:
    print("NO")

N=int(100005)
a=[int(0) for i in range(N)]

Submission status: Accepted

Solution code:
# coding: utf-8
import heapq
n = int(input())
nums = sorted([int(x) for x in input().split()])
flag = "YES"
for i in range(n-1):
    if nums[i] == nums[i+1]:
        flag = "NO"
        break
print(flag)

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(0)

print("YES")