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
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#main
n=int(input())
A=list(map(int,input().split()))
YN(len(A)==len(set(A)))

Submission status: Accepted

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

S = set(A)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = set()

for a in A:
    if a not in S:
        S.add(a)
    else:
        ans = 'NO'
        break
else:
    ans = 'YES'

print(ans)

Submission status: Accepted

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

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

from collections import Counter

c = Counter(A)

for i in c.values():
    if i != 1:
        print("NO")
        sys.exit()
print("YES")

Submission status: Accepted

Solution code:
n=int(input())
alist = list(map(int, input().split()))
alist=sorted(alist)
swit=0
for i in range(n-1):
    if alist[i]==alist[i+1]:
        swit=1

if swit==0:
    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()))

num_a = len(A)
set_a = len(set(A))

if num_a == set_a:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
tmp = len(set(input().split()))

if tmp == n:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

x=a[0]
for i in range(1,len(a)):
    if x==a[i]:
        print('NO')
        exit()
    else:
        x=a[i]
print("YES")

Submission status: Accepted

Solution code:
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

n=input()
a=list(input().split())
a.sort()
for i in range(1,len(a)):
    if a[i]==a[i-1]:
        print("NO")
        quit()
print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    N = int(input())
    A = list(iim())

    A.sort()
    for i in range(1, len(A)):
        if A[i-1] == A[i]:
            print("NO")
            return
    print("YES")

if __name__ == "__main__":
    resolve()

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 = list(map(int,input().split()))
flag = 0
A.sort()
for i in range(len(A)-1):
    if A[i] == A[i+1]:
        flag += 1
        print("NO")
        break
    else:
        continue
if flag == 0:
    print("YES")

Submission status: Accepted

Solution code:
N = input()
A = [i for i in 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()))
B = list(set(A))

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a2=sorted(a)
now=a2[0]
c=0
for i in range(1,n):
    if now==a2[i]:
        c=1
        break
    now=a2[i]
print("YES" if c==0 else "NO")

Submission status: Accepted

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

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

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:
n = int(input())
d = {}
for i in map(int, input().split()):
    if i not in d:
        d[i] = 1
    else:
        print('NO')
        break
else:
    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:
def examA():
    S, T = LSI()
    A, B = LI()
    U = SI()
    if S==U:
        print(A-1,B)
    else:
        print(A,B-1)
    return

def examB():
    S = SI()
    N = len(S)
    ans = ""
    for i in range(N):
        ans += "x"
    print(ans)
    return

def examC():
    N = I()
    A = LI()
    d = defaultdict(int)
    for a in A:
        d[a] += 1
        if d[a]>=2:
            print("NO")
            return
    print("YES")
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examC()

"""

"""

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())
print('YES' if len(set(map(int, input().split()))) == N else 'NO')

Submission status: Accepted

Solution code:
import sys

n, *a = map(int, sys.stdin.read().split())

def main():
    return 'YES' if len(set(a)) == n else 'NO'

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

Submission status: Accepted

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

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

Submission status: Accepted

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

B = len(set(A))
if N == B:
    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 = 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 = list(map(int,input().split()))
print('YES') if len(set(A)) == len(A) else print('NO')

Submission status: Accepted

Solution code:
n = int(input())
A = set(map(int,input().split()))
if len(A) != n:
    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:
N = int(input())
a = list(map(int, input().split()))
s = set(a)

print("YNEOS"[len(a) != len(s)::2])

Submission status: Accepted

Solution code:

N = int(input())
A = list(set([int(i) for i 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()))
if len(A) == len(set(A)):
    print('YES')
else:
    print('NO')

Submission status: Accepted

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


table = collections.defaultdict(int)
for x in A:
    table[x] += 1
    if table[x] > 1:
        print("NO")
        exit(0)
print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res

N=II()
inl = LI()
if len(set(inl)) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
if len(set(LI())) == n:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
from collections import defaultdict

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

D = defaultdict(int)

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
c = list(Counter(a).items())
c.sort(key = itemgetter(1),reverse=1)
if c[0][1] > 1:
    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(n-1):
    if a[i+1] == a[i]:
        print("NO")
        exit()
print("YES")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
 
N = int(input())
a = [int(i) for i in input().split()]
a1 = set(a)
 
if len(a) == len(a1):
    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("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
dat = list(map(int, input().split()))
f = True
d = dict()
for i in range(len(dat)):
    if dat[i] in d:
        f = False
    d[dat[i]] = True
print("YES" if f else "NO")

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


a.sort()


def f(a):
    for i in range(len(a)-1):
        if(a[i]==a[i+1]):
            return False
    return True

if(f(a)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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


SA = set(A)

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

Submission status: Accepted

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
for k in range(1,N):
    if A[k-1] == A[k]:
        print("NO")
        exit(0)
print("YES")

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:
N = int(input())
A = list(map(int, input().split()))

st = set(A)
if len(A) == len(st):
    print("YES")
else:
    print("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:
n = int(input())
al = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
import sys

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

A.sort()

before = 0
for i in range(N):
    if A[i] == before:
        print("NO")
        sys.exit()
    before = A[i]

print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

N = I()
A = III()

A.sort()
for i in range(len(A)-1):
    if A[i]==A[i+1]:
        print('NO')
        exit()

print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=set([int(j) for j 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()))

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")
from collections import Counter


def yes():
    print("YES")  # type: str


def no():
    print("NO")  # type: str


def solve(N: int, A: "List[int]"):
    counter = Counter()
    flag = True
    for a in A:
        counter[a] += 1
        if counter[a] > 1:
            flag = False
            break
    if flag:
        yes()
    else:
        no()

    return


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:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
if len(Counter(A).values()) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    la = rli()
    sa = set(la)
    if len(la) == len(sa):
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Summarize count of factor within list -- START --
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res
# Summarize count of factor within list --- END ---

def main():
  n=I()
  l=LI()

  l=summarize_list(l)

  for x,y in l:
    if y!=1:
      return 'NO'
  return 'YES'

# main()
print(main())

Submission status: Accepted

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

print('YES' if n == len(set(al)) else 'NO')

Submission status: Accepted

Solution code:
D = {}
N = int(input())
A = list(map(int, input().split()))
for i in A:
  if i in D:
    D[i] += 1
  else:
    D[i] = 1
if max(D[i] for i in D) == 1:
  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 'NO')

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

Submission status: Accepted

Solution code:

N = int(input())

ans = "YES"

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

dic = {}

for i in A:
    if i in dic:
        ans = "NO"
        break
    else:
        dic[i] = 1

print (ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

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

def solve(N: int, A: "List[int]"):
    from collections import Counter
    c = Counter(A)
    if len([k for k,v in c.items() if v != 1]) == 0:
        print(YES)
    else:
        print(NO)
    return



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:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
if len(list(set(A))) == len(A):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n=int(input())
A=list(map(int,input().split()))
s=set()
for i, ai in enumerate(A):
    if ai in s:
        print("NO"); exit()
    else:
        s.add(ai)
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:
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:
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    s = set(A)
    if N == len(s):
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in 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()))
print("YES" if len(A) == len(set(A)) else "NO")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
s = set()
for x in a:
  if x in s:
    print("NO")
    exit(0)
  s.add(x)
print("YES")

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = list(set(li))
if len(lin) == 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:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = map(int, input().split())
    t = set()
    for a in A:
        if a in t:
            print('NO')
            return
        t.add(a)
    print('YES')


main()

Submission status: Accepted

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

a = sorted(a)

t = a[0]

for i in range(1,n):
    if t == a[i]:
        print('NO')
        exit()
    else:
        t = a[i]

print('YES')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI()
    if len(A) == len(list(set(A))):
        print('YES')
    else:
        print('NO')

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

b=set(a)

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

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    
    a = len(A)
    s = len(set(A))

    return 'YES' if a == s else 'NO'

print(solve())

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in 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, *a = map(int, open(0).read().split())
print("YNEOS"[len(set(a))!=len(a)::2])

Submission status: Accepted

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

    s = set(a)

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


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

Solution code:
N = int(input())
Alist = list(map(int, input().split()))
Aset = set(Alist)
if len(Alist) == len(Aset):
    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:
N = int(input())
A = [int(_) for _ in input().split()]
print('YES' if len(set(A)) == N else 'NO')

Submission status: Accepted

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

M = len(A)

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

Submission status: Accepted

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

flag = True
for a in arr:
    if a not in d:
        d.add(a)
    else:
        flag = False
        break

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

Submission status: Accepted

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

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