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

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

res = True

s = mergeSort(a)

if res:

    print("YES")

else:

    print("NO")
n = int(eval(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")
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(eval(input()))
a = list(map(int, input().split()))
res = True
s = mergeSort(a)
if res:
    print("YES")
else:
    print("NO")

n = int(eval(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")

-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 - - -s = mergeSort(a) +a.sort() +for i in range(1, n): +    if a[i - 1] == a[i]: +        res = False +        break