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:
def main():
    N = input()
    A = input().split()

    _A = set(A)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

_A = set(A)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = int(input())
ls = list(set([int(c) for c in input().split()]))
if len(ls) == l:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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


S = 1
for i in range(N-1):
    if  li[i+1] == li[i]:
        S = S*0
    else:
        S = S
if S == 0:
    print('NO')
else:
    print('YES')

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()))
res = True
a.sort()
for i in range(1,n):
    if a[i-1]==a[i]:
        res = False
        break
if res:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def merge(l,r,a):
    l1 = len(l)
    r1 = len(r)
    i,j,k = 0,0,0
    while j<l1 and k<r1:
        if l[j]<r[k]:
            a[i] = l[j]
            j+=1
        elif l[j] == r[k]:
            a[i]=l[j]
            j+=1
            global res
            print("NO")
            quit()
            return 0
        else:
            a[i] = r[k]
            k+=1
        i+=1
    while j<l1:
        a[i] = l[j]
        j+=1
        i+=1
    while k<r1:
        a[i] = r[k]
        k+=1
        i+=1
    return a

def mergeSort(a):
    n = len(a)
    if n == 1:
        return a
    else:
        mid = n//2
        left = []
        right = []
        for i in range(mid):
            left.append(a[i])
        for i in range(mid, n):
            right.append(a[i])
        mergeSort(left)
        mergeSort(right)
        merge(left,right,a)
        return a


n = int(input())
a = list(map(int,input().split()))
res = True
s = mergeSort(a)
if res:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def merge(l,r,a):
    l1 = len(l)
    r1 = len(r)
    i,j,k = 0,0,0
    while j<l1 and k<r1:
        if l[j]<r[k]:
            a[i] = l[j]
            j+=1
        elif l[j] == r[k]:
            a[i]=l[j]
            j+=1
            global res
            res = False
            return 0
        else:
            a[i] = r[k]
            k+=1
        i+=1
    while j<l1:
        a[i] = l[j]
        j+=1
        i+=1
    while k<r1:
        a[i] = r[k]
        k+=1
        i+=1
    return a

def mergeSort(a):
    n = len(a)
    if n == 1:
        return a
    else:
        mid = n//2
        left = []
        right = []
        for i in range(mid):
            left.append(a[i])
        for i in range(mid, n):
            right.append(a[i])
        mergeSort(left)
        mergeSort(right)
        merge(left,right,a)
        return a


n = int(input())
a = list(map(int,input().split()))
res = True
s = mergeSort(a)
if res:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(z) for z in input().split()]
st = set()
for i in a:
  if i in st:
    print("NO")
    exit(0)
  st.add(i)
print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = list(map(int, input().split()))
l = collections.Counter(A)
if N == len(l):
    print("YES")
elif N != len(l):
    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 checker(arr):
  d = {}
  for x in arr:
    if x not in d:
      d[x] = 1
    else:
      return "NO"
  return "YES"

n = int(input())
arr = list(map(int, input().split()))
print(checker(arr))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

C=0

A.sort()

for i in range(N-1):
    if A[i] == A[i+1]:
        C = C+1
    else:
        C = C

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

Submission status: Accepted

Solution code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N = read_int()
    A = read_int_list()
    A.sort()
    s = []
    for i in range(N-1):
      if A[i+1] != A[i]:
        s.append(A[i])
    l = len(s)
    if l == N - 1:
      res = 'YES'
    else:
      res = 'NO'
    print(res)


main()

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = tuple(map(int, input().split()))
A = np.array(A)
A = np.sort(A)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
s = set()
for a in A:
    if not a in s:
        s.add(a)
    else:
        print('NO')
        exit()
print('YES')

Submission status: Accepted

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

flag=False
for i in range(N - 1):
  flag = flag or A[i] == A[i + 1]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A.sort()
flag = False
for count in range(0,len(A)-1):
    if A[count] == A[count+1]:
        flag = True
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

A.sort()

count = 0
for i in range(N-1):
    if A[i] == A[i+1]:
        count += 1
        break

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

Submission status: Accepted

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

p = len(a)
q = len(set(a))

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

Submission status: Accepted

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

if len(a) == 1:
    print("YES")
    exit()

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

Submission status: Accepted

Solution code:
def solve(string):
    n, *a = map(int, string.split())
    return "YES" if len(a) == len(set(a)) else "NO"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    n = II()
    a = LI()
    print("YES" if len(a) == len(set(a)) else "NO")
    return


#main
if __name__ == '__main__':
    solve()

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

    beforeLen = len(num_list)

    num_list = set(num_list)

    afterLen = len(num_list)

    print('YES' if beforeLen == afterLen else 'NO')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = {}
res = True

for i in A:
    if i in m:
        res = False
        break
    else:
        m[i] = True

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = list(set(A))
print('YES' if sorted(A) == sorted(B) 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:
n = int(input())
a = list(map(int, input().split()))
lst = []
if len(set(a)) != len(a):
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
import sys
input()
s=sorted(input().split())
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        print("NO")
        sys.exit(0)
print("YES")

Submission status: Accepted

Solution code:
n=int(input())
List=list(map(int,input().split()))
Set=set()
for i in range(len(List)):
    Set.add(List[i])
if len(Set)==n :
    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:
import sys
n = int(input())
a = sorted(list(map(lambda x: int(x),input().split())))
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())
a = list(map(int, input().split()))

a.sort()

bef = a[0]
for i in range(1, n):
    if a[i] == bef:
        print('NO')
        exit(0)
    bef = a[i]
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()))
tmp=set(A)
tmp=list(tmp)


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

Submission status: Accepted

Solution code:
N = int(input())
n = [int(i) for i in input().split()]
print("YES" if len(set(n)) == N else "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:
#abc154c
n=int(raw_input())
a=map(int,raw_input().split())
if len(a)==len(set(a)):
 print 'YES'
else:
 print 'NO'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

input()
print("YES" if not set(Counter(input().split()).values()) - {1} else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import hashlib
import math

class BloomFilter:

    def __init__(self, num_item, false_positive):
        assert 0 <= false_positive <= 1
        # Optimal number of bit array size and hash function
        # https://en.wikipedia.org/wiki/Bloom_filter#Optimal_number_of_hash_functions
        log2 = math.log(2)
        logp = math.log(false_positive)
        size = - num_item * logp / (log2 * log2)
        num_hash = size / num_item * log2

        self.size = int(math.ceil(size))
        self.num_hash = int(math.ceil(num_hash))

        self.array = self.BitArray(self.size)
        self.hash_functions = [self.HashFunction(i, self.size)
                               for i in range(self.num_hash)]

    def add(self, item):
        for hash_func in self.hash_functions:
            i = hash_func(item)
            self.array[i] = True

    def __contains__(self, item):
        return self.contains(item)

    def contains(self, item):
        for hash_func in self.hash_functions:
            i = hash_func(item)
            if self.array[i] is False:
                return False
        return True

    class BitArray:

        def __init__(self, length):
            # Allocate an object per a bit for simplicity
            self.array = [False for _ in range(length)]

        def __getitem__(self, index):
            return self.get(index)

        def get(self, index):
            return self.array[index]

        def __setitem__(self, index, bit):
            return self.set(index, bit)

        def set(self, index, bit):
            if bit > 0 or bit is True:
                self.array[index] = True
            else:
                self.array[index] = False

    class HashFunction:

        def __init__(self, seed, maximum):
            self.seed = seed.to_bytes(
                seed.bit_length() // 8 + 1, byteorder='big')
            self.maximum = maximum

        def __call__(self, byte_buffer):
            return self.call(byte_buffer)

        def call(self, byte_buffer):
            # MD5 is enough because I don't want to oneway hash function
            b = hashlib.md5(byte_buffer + self.seed).digest()
            i = int.from_bytes(b, byteorder='big', signed=False)
            return i % self.maximum

N = int(input())
L = list(map(int,input().split()))
bf = BloomFilter(num_item=5 * 10 ** 5, false_positive=0.001)

L = sorted(L)
for i in range(len(L) - 1):
    if L[i] == L[i+1]:
        print("NO")
        quit()
print("YES")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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(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()))
ans = set()
for a in A:
    ans.add(a)
if len(ans) == N:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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()))
if len(A)==len(set(A)):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=map(int,input().split())
d={}
for i in a:d[i]=1
if len(d)<n: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]==a[i+1]:
        print("NO")
        exit()

print("YES")

Submission status: Accepted

Solution code:
n = int(input())
string_list = list(input().split())

string_hash = {}
cnt = False

for s in string_list:
    if s in string_hash:
        cnt = True
        break
    else:
        string_hash[s] = 1

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

if len(listn) == len(setn):
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
#coding:utf-8
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())
data = list(map(int, input().split()))

data.sort()

ans = "YES"
for i in range(len(data) - 1):
  if data[i] == data[i+1]:
    ans = "NO"
    break

print(ans)

Submission status: Accepted

Solution code:
N=int(input())

A = list(map(int, input().split()))
A.sort()
flag=False

for i in range(N-1):
  if A[i]==A[i+1]:
    print("NO")
    flag=True
    break
if flag==False:
  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]"):
    if len(set(A)) == N:
        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:
import sys
stdin = sys.stdin
from collections import deque

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

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

Submission status: Accepted

Solution code:

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

if __name__ == '__main__':
  	main()


'''
6
4 1 3 1 6 2
'''

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = len(set(a))

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
d = dict()
num = list(map(int, sys.stdin.readline().rstrip().split()))
res = "YES"
for i in range(n):
    try:
        if d[num[i]] >= 1:
            res = "NO"
            break
    except:
        d[num[i]] = 1
print(res)

Submission status: Accepted

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

if len(A_list) != len(A_set):
  ans = 'NO'
else:
  ans = 'YES'

print(ans)

Submission status: Accepted

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

isDistinct = True
for i in range(len(a)):
    if(a[i] == a[i - 1]):
        isDistinct = False
        break;

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

Submission status: Accepted

Solution code:
N=input()
An = input()
list_An=[]
a = 0
for i in range(len(An)):
    if An[i]==" ":
        list_An.append(int(An[a:i]))
        a = i+1
list_An.append(int(An[a:len(An)]))
list_An.sort()
A = 0
for i in range(len(list_An)):
    if list_An[i-1]==list_An[i]:
        print("NO")
        A = 1
        break    
if A == 0:
    print("YES")

Submission status: Accepted

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

distinct = True
dic = {}

for x in a:
    if x in dic:
        distinct = False
        break
    dic[x] = True

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
count = 0
for i in range(N-1):
    if A[i] == A[i+1]:
        print("NO")
        count = 1
        break
if  not count == 1:
    print("YES")

Submission status: Accepted

Solution code:
# C - Distinct or Not
print(['YES','NO'][int(input()) != len(set(input().split()))])

Submission status: Accepted

Solution code:
# C - Distinct or Not
_ = input()
a = input().split()
print(['YES','NO'][len(a) != len(set(a))])

Submission status: Accepted

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

# N=6
# A = [4,1,3,1,6,2]


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

Submission status: Accepted

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

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 = [int(x) for x in input().split()]

# N=6
# A = [4,1,3,1,6,2]


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial

sys.setrecursionlimit(10**7)
N = int(input())
A = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
Data = list(map(int,input().split()))
Dic = {}
for d in Data:
    if d in Dic:
        print('NO')
        sys.exit()
    else:
        Dic[d]=1
print('YES')

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

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

Submission status: Accepted

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

import collections

c = collections.Counter(A)
values, counts = zip(*c.most_common())

if counts[0] != 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import numpy as np
import collections
from functools import cmp_to_key
import heapq

##  input functions for me
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
def main():
    n = ri()
    A = ria()
    s = set()
    for v in A:
        s.add(v)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = 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()))
flag = True
A.sort()
for i in range(1,len(A)):
  if A[i-1] == A[i]:
    flag = False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def has_duplicates(seq):
    if len(seq)==len(set(seq)):
        return 0
    else:
        return 1

if has_duplicates(A)==0:
    print("YES")
elif has_duplicates(A)==1:
    print("NO")

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
n = int(input())
numbers = []

for i in map(int,input().split()):
  numbers.append(i)

a = sorted(list(set(numbers)))
b = sorted(numbers)
  
if a == b:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = set(map(int, input().split()))
if len(a) == n:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
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()))
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=sorted(A)

for i in range(0,N):
  if len(A) > i+1:
    if A[i] == A[i+1]:
      print("NO")
      exit(0)
print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Invalid = 0
A.sort()

for i in range(len(A)-1):
    if A[i] == A[i+1]:
        Invalid = 1

print('YES' if not Invalid else 'NO')

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
a_len = len(a)
a_set = set(a)

if a_len == len(a_set):
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

before_num = len(a_list)

a_syu = list(set(a_list))
after_num = len(a_syu)

if before_num == after_num:
    print("YES")
else:
    print("NO")