n = int(eval(input()))

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



nozoki = sorted(list(set(li)))

li.sort()

if (nozoki == li):

    print("YES")

else:

    print("NO")
n = int(eval(input()))

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

a = len(li)

se = set(li)

b = len(se)

if (a==b):

    print("YES")

else:

    print("NO")
n = int(eval(input()))
li = [int(x) for x in input().split()]
nozoki = sorted(list(set(li)))
li.sort()
if nozoki == li:
    print("YES")
else:
    print("NO")

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

-nozoki = sorted(list(set(li))) -li.sort() -if nozoki == li: +a = len(li) +se = set(li) +b = len(se) +if a == b: