peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
A = list(map(int, input().split())) 
if list(set(A)) == A:
    print('YES')
else:
    print('NO')
a=int(input())
b=list(map(int,input().split()))
c=set(b)
if len(c)==len(b):
  print("NO")
else:
  print("Yes")
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")
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

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

d = {}
for i in m:
    if i in d:
        print("No")
        exit(0)
    d[i] = 1
print("Yes")
N = int(input())
A = list(map(int,input().split()))
b = list(set(A))
if b == A: print ('YES')
else: print ('NO')
n = int(input())
a = list(map(int, input().split()))
set_a = set(a)
if len(a) == len(set_a):
    print('Yes')
else:
    print('No')
def has_duplicates(seq):
    return len(seq) != len(set(seq))


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

flg = has_duplicates(a)

if flg:
    print('YES')
else:
    print('NO')
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)
a = int(input())
b = list(map(int,input().split()))

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

a_set = set(a)
if len(a) == len(a_set):
  print('Yes')
else:
  print('No')
n = int(input())
a = list(map(int, input().split()))
if len(set(a)) == len(a):
    print('Yes')
else:
    print('No')
cnt = int(input())
tar_array = input().split()
tar_array.sort()

out = "YES"
tar = ""
print(tar_array)
for i in range(cnt):
  if tar == tar_array[i]:
    out = "NO"
    break
  tar = tar_array[i]

print(out)
from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
A = A.values()
for a in A:
    if a != 1:
        print("NO")
        exit()
print("Yes")
def judge(s):
  s=sorted(s)
  t=list(set(s))
  if s==t:
    return "YES"
  else:
    return "NO"

n=int(input())
a=list(map(int,input().split()))
result=judge(a)
print(result)
n = int(input())
a = sorted(list(map(int, input().split())))

count = 0

for i in range(n-1):
    if a[i] == a[i + 1]:
        count += 1
if count == 0:
    print('Yes')
else:
    print('No')
n=int(input())
a=list(map(int,input().split()))

a_list1=sorted(a)

a_set=set(a_list1)

a_list2=list(a_set)


if a_list1==a_list2:
    print('YES')
        
else:
    print('NO')
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)
if M == X:
    print("YES")

else:
    print("NO")
n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n-1):
    if l[i]==l[i+1]:
        f=0
        break
print("YES") if f else print("NO")
n=int(input())
a=list(map(int,input().split()))
f=False

for i in range(n):
  b=a.pop(0)
  if b in a:
    f=True
    break

if f:
  print('No')
else:
  print('Yes')
N = input()
a = input().split()

def has_duplicates(seq):
    return len(seq) != len(set(seq))
  
b = has_duplicates(a)
if b == True:
  print('YES')
if b == False:
  print('NO')
num = int(input())
numbers_row = input().split(" ")
numbers = []
for i in numbers_row:
  numbers.append(int(i))
  
Bool = len(numbers) != len(set(numbers))

if Bool == True:
    print("No")
else:
    print("YES")
num = int(input())
num_list = list(map(int,input().split()))

base = len(set(num_list))

if base == num:
  ans = "Yes"
elif not base == num:
  ans = "No"

print(ans)
N=int(input())
A=list(map(int,input().split()))
count=0

for i in range(N):
  if A.count(A[i]) !=0:
    count=count+1
if count==0:
  print("YES")
else:
  print("NO")
import sys
input = sys.stdin.readline


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

cnt= len(A)
print(cnt)
cnts = 0
isYes = True

for i in A:
    if A.count(i) > 1:
        isYes = False
        break
    else:
        isYes = True
 
    if cnts == cnt:
        isYes = True
        break
    cnts += 1

if isYes:
    print("YES")
else:
    print("NO")
n = int(input())
a = list(map(int, input().split()))

flag = 1
for i in range(n):
    if flag == 0:
        break
    for j in range(i, n):
        if a[i] == a[j]:
            flag = 0
            break

if flag == 1:
    print("YES")
else:
    print("NO")
t=list(input().replace(" ",""))
n=len(t)
p=0
for i in range(1,n):
    for j in range(i+1,n):
        if t[i]==t[j]:
            p+=1
if p>0:
    print("NO")
else:
    print("YES")
N=int(input())
A=list(map(int,input().split()))
B=set(A)
if len(A)==len(B):
  print("Yes")
else:
  print("No")
n=int(input())
a=list(map(int,input().split()))
m=min(a)
M=max(a)
t=0
while(m<=M):
  if a.count(m)>1:
    m=M+2
    print("YES")
  else:
    m=m+1
if m==M+1:
  print("NO")
N = int(input())
A = list(map(int, input().split()))  # [1, 2, 3, 4] になる

len2 = len(set(A))

if N == len2:
    print('Yes')
else:
    print('No')
import sys

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

for i in range(len(data)):
  for j in range(1, len(data) - i):
    d1 = data[i]
    d2 = data[i+j]
    if (d1 == d2):
      print("No")
      sys.exit()()

print("Yes")
n=int(input())
l1=list(map(int,input().split()))

if(len(l1)==len(set(l1))):
    print("Yes")
else:
    print("No")
line1 = input()
line2 = input()
num_list = line2.split(" ")

for num in num_list:
    if num_list.count(num) >= 2:
        print("NO")
        break
print("YES")
N = int(input())
A = list(input().split())

if len(set(A)) == N:
  print('Yes')
else:
  print('No')
import sys
N = int(input())
A = list(map(int,input().split()))
count1 = 1
count2 = 0
for i in range(N - 1):
  for j in range(count1,N):
    if A[i] == A[j]:
      print("YES")
      sys.exit()
    else:
      pass
  count1 += 1  
print("YES")
N = int(input())
numbers = list(map(int, input().split()))

if len(numbers) == N:
  print('YES')
else:
  print('NO')
n =int(input())
a = list(map(int,input().split()))
x=0
for i in range(n):
  if a.count(a[i]) != 1:
    print("NO")
    x=1
    break
    
if x == 0:
  print("Yes")
N=int(input())
A=list(map(int,input().split()))
flag=0
for i in range(N):
    for j in range(i+1,N):
        if(A[i]==A[j]):
            flag=1
            break
    if(flag==1):
        break

if(flag==1):
    print("YES")
if(flag==0):
    print("NO")
import sys

N = int(input())
AList = list(map(int, input().split()))
AList.sort()

for i in range(1, N):
    if AList[i - 1] == AList[i]:
        print('No')
        sys.exit()
        
print('Yes')
import numpy as np
n = int(input())
b = list(int(x) for x in input().split())
a = np.array(b)
x = 0
for i in range(n):
    if (a[0] in np.delete(a, 0)) is True:
        print("NO")
        x = 1
        break

if x == 0:
    print("YES")
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)

for i in range(1, N):
  if A[i-1] == A[i]:
    print("No")
    exit()
print("Yes")
n = int(input())
a = set(input().split())
print('Yes' if len(a) == n else 'No')
n = int(input())
S = list(map(int, input().split()))
setS = list(set(S))

print('Yes' if len(S) == len(setS) else 'No')
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')
import sys

stdin = sys.stdin

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

n = ni()
a = na()
a.sort()

diff = True
for i in range(n-1):
    if a[i] == a[i+1]:
        diff = False
if diff:
    print("Yes")
else:
    print("No")
n = int(input())
a = list(map(int, input().split()))
lst = []
for x in a:
  if x in lst:
    print('No')
    break
  lst.append(x)
else:
  print('YES')
a = input()
b = input().split()
c = 0
for i in a:
    for l in a:
        if i == l:
            c += 1
if c > 0:
    print("YES")
else:
    print("NO")
n = int(input())
a = [int(i) for i in input().split()]

a = sorted(a)

for i in range(n-1):
    if a[i] == a[i+1]:
        print("No")
        exit()
print("Yes")
stdin = open(0).read().split('\n')
N = int(stdin[0])
A = list(map(int,stdin[1].split()))
B = set(A)
print('Yes' if len(A)==len(B) else'No')
import sys
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")
		sys.exit()
print("Yes")
n=int(input())
a=[int() for i in input().split()]
b=0
for j in range(n):
  for k in range(n):
    if a[j]==a[k]:
      b+=1
      break
if b==0:
  print('Yes')
else:
  print('No')
from  collections import Counter
n = int(input())
a_ = [int(x) for x in input().split()]
a = Counter(a_)
print(a)
print('NO') if a.most_common()[0][1]>1 else print('YES')
n = int(input())
a = list(map(int,input().split()))

from collections import Counter
b = Counter(a)

for i in b.values():
    if i>1:
        print('NO')
else:
    print('YES')
n = int(input())
a = list(map(str,input().split()))
ans = 'Yes'
for i in range(n):
    if a.count(a[i]) != 1:
        ans = 'No'
        break
print(ans)
import sys

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

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

print('YES')
N = int(input())
A = list(map(int,input().split()))
for i in range (N):
  for j in range (i+1,N):
    if A[i]==A[j]:
      print('No')
      exit()
      
print('Yes')
n=int(input())
a=list(map(int,input().split()))
cnt=0

for i in a:
	for j in a[i:]:
		if i==j:
			cnt+=1
			break
		else:
			break

if cnt==0:
	print("Yes")
else:
	print("No")
s=input()
array=[]
array+=(int(x) for x in input().split())

def judge(array,s):
  for i in range(int(s)-1):
    if array[i] == array[i+1]:
        return False
  else:
    return True

print(judge(array,s))
n=int(input())
a=list(map(int,input().split()))

a_list1=sorted(a)

a_set=set(a)

a_list2=list(a_set)

if a_list1==a_list2:
    print('YES')
    
else:
    print('NO')
n = int(input())
arr = list(map(int, input().split()))

# arr = list(filter(lambda x: x == n, arr))
# print(arr)
flag = False
for i in arr:
    tmp_arr = list(filter(lambda x: x == i, arr))
    if arr.count(i) >= 2:
        flag = True
        break

if flag: print("No")
else: print("Yes")
t=input().split()
m=t.pop(0)
n=int(m)
if len(set(t))==n:
    print("YES")
else:
    print("NO")
s = input()
a = map(int, input().lower().split())
if list(a) == list(set(a)):
  	print("YES")
else:
  	print("NO")
n = int(input())
*l, = map(int, input().split())
def has_duplicates(seq):
    return len(seq) != len(set(seq))
S = has_duplicates(l)
if str(S) == 'False':
  print('NO')
elif str(S) == 'True':
  print('YES')
n=int(input())
a=list(map(int,input().split()))
ans='YES'
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        ans='No'
        break
print(ans)
from collections import Counter
N = int(input())
A = [int(x) for x in input().split()]

k = Counter(A)

if len(k) == len(A):
    print("Yes")
else:
    print("No")
N=input()
A=input().split()

if N==A:
    print("YES")
else:
    print("NO")
n =int(input())
a = list(map(int,input().split()))
if n == len(set(a)):
    print("Yes")
else:
    print("No")
t=input().split()
n=int(t.pop(0))
if len(set(t))==n:
    print("YES")
else:
    print("NO")
N = input()
A = list(map(int, input().split()))
ans = ""
for i in range(len(A)):
    if A[i] == A[:i:]:
        ans = "YES"
        break
    else:
        ans ="NO"
    
print(ans)
n=int(input())
a=list(map(int,input().split()))
b=set(a)
if len(a)==len(b):
  print("Yes")
else:
  print("No")
n=int(input())
a=list(map(int,input().split()))
ans='YES'
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        ans='nO'
        break
print(ans)
N = int(input())
A = input().split()

L = []

for i in range(N):
  if A[i] not in L:
    L.append(A[i])
    if i == N-1:
      print('Yes')
  else:
    print('No')
    break
from collections import defaultdict
n=int(input())
x=list(map(int,input().split()))
a=defaultdict(int)
f=True

for y in x:
    if a[y]==1:
        f=False
        break
    a[y]=1
    
if f:
    print("yes")
else:
    print("no")
# C
import numpy as np
import itertools
N = int(input())
A = list(map(int,input().split()))

A.sort()

list_tmp=[ A[i+1]-A[i] for i in range(N-1)]

if 0 in list_tmp:
    print("No")
else:
    print("Yes")
n=int(input())
a=list(map(int,input().split()))
ans='Yes'
for i in range(1,n):
    for j in range(i):
        if a[i]==a[j]:
            ans='No'
            break
print(ans)
import sys
A = list(map(int, input().split()))

if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")
import sys
N = int(input())
A = list(input().split())
def has(s):
    return len(s) != len(set(s))
B = A
B = has(A) 
if B == False:
    print("NO")
    sys.stdout.flush
else:
    print("YES")
    sys.stdout.flush
N=int(input())
L = [int(x) for x in input().split()]

LS=sorted(L)

for i in range(N-1):
    if LS[i]==LS[i+1]:
        print('YES')
        break
    if i==N-2:
        print('NO')
n=int(input())
a=list(map(int,input().split()))
b=len(set(a))
if n==b:
    print('Yes')
else:
    print('No')
from collections import Counter
input()
lst=list(map(int,input().split()))
dic=dict(Counter(lst))
x=max(list(dic.values()))-1
if x:
  print('No')
else:
  print('Yes')
n=int(input())
a=list(map(int,input().split()))

if len(a)==len(set(a)):
    print('Yes')
else:
    print('No')
x = list(map(int,input().split()))
print("YES" if len(x)==len(set(x)) else "NO")
import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 1
i_before = a[0]
for i in a:
    ans *= (i - i_before)
    i_before=i
if i ==0:
    print('No')
else:
    print('Yes')
n = int(input())
a = list(map(int,input().split()))

count = 0
list00 = sorted(a)
for i in range(1, n):
  if a[i-1] == a[i]:
    count = count
  else:
    count = count + 1

if count == n-1:
  print('YES')
else:
  print('NO')
n = int(input())
a = list(map(int, input().split()))
if len(set(a)) == n:
    print('No')
else:
    print('Yes')
n = int(input())
a = list(map(int,input().split()))

# a = [1,2,3,3,2,2,1]
# s = set(a)
# print(s)
# >>[1,2,3]

if len(set(a)) == n:
    print("Yes")
else:
    print("No")
n=int(input())
a=[]
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)
a=int(input())
b=list(input().split())
c=sorted(b)
for i in range (a-1):
 if c[i]==c[i+1]:
  print("NO")
  break
 else:
  print("YES")
  break
def onlya(n , a):

    ans = "YES"

    for i in range(n):
        for w in range(i + 1 , n):
            print(a[i])
            print(a[w])
            if a[i] == a[w]:
                return "NO"

    return ans

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(onlya(n , a))

if __name__ == '__main__':
    main()
input();a=str(input());print("NYOE S"[len(a.replace(" ",""))==len(set(a))-1::2])
n =int(input())
list = list(input().split())


set = set(list)

if len(set) == n:
    print('Yes')
else:
    print('No')
a = list(map(int, input().split()))
print('YNEOS'[len(a) > len(set(a))::2])
N = int(input())
A = list(map(int,input().split()))
B = set(A)
if len(A)==len(B):
  print('Yes')
else:
  print('No')
a=int(input())
b=list(map(int,input().split()))
i=0
c="YES"   ##ここ文字列だからくおーてーしょんいるの注意
for i in range(a):
 j=i+1
 for j in range(a):
    if b[i]==b[j]:
     c="NO" ##ここも
print(c)
N = int(input())
A = list(map(int, input().split()))

if N == len(set(A)): print('Yes')
else: print('No')
N=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
#e1,e2 = map(int,input().split())
A = list(map(int,input().split()))
#j = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
A.sort()
ans="Yes"
for i in range(1,N):
    if A[i-1]==A[i]:
        ans="NO"
print(ans)
S=int(input())
T = input().split()
U = [int(i) for i in T]
U.sort
r = 0

for i in range(S-1):
  if(T[i] == T[i+1]):
    r+=1
    
if(r==0):
  print("YES")
else:
  print("NO")
N = int(input())
a = list(map(int, input().split()))
D = N + 1
A = 0
while A <= N - 1:
    if a.count(a[A]) == 1:
        A += 1
    else:
        break
        print('NO')
if A == N:
    print('YES')
N = int(input())
List = list(map(str, input().split()))
import collections
c = collections.Counter(List)
#print(c)
if len(c)==N:
    print('Yes')
else:
    print('No')
n = int(input())
a = list(map(int, input().split()))
d = dict()
for i in range(n):
    d.setdefault(a[i])
if len(d) != n :
    print("No")
else:
    print("Yes")
N=int(input())
A_list=list(map(int,input().split()))

flag = True
for i in range(N):
    target = A_list[i]
    for j in range(i+1, N):
        if target == A_list[j]:
            flag = False
            break
    if flag == False:
        break

if flag:
    print('Yes')
else:
    print('No')
import sys

def binary_search(li, item):
  low = 0
  high = len(li) - 1
  
  while low <= high:
    mid = (low + high) // 2
    guess = li[mid]
    if item == guess:
      return True
    if item < guess:
      high = mid-1
    else:
      low = mid+1
  return False

n = int(input())
a_li = list(map(int, input().split()))
a_li.sort()
for a in a_li:
  if binary_search(a_li, a) == True:
    print("NO")
    sys.exit()
print("YES")
n = int(input())
lst = list(map(int, input().split()))

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

if has_duplicates(lst)==True:
    print("No")
else:
    print("Yes")
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
    if i==N-2:
        print("Yes")
N=int(input()) 
A=list(map(int,input().split()))
a=[]
for i in range(N):   
    if A[i] in a:
        print("NO")
    else:
        a.append(A[i])
        if i==N-1:print('YES')
n = int(input())
*l, = map(int, input().split())
L = sorted(l)
S = 0
for i in range(n):
  for l in range(n):
    if L[i] == L[l]:
      S = 1
if S == 0:
  print('YES')
elif S == 1:
  print('NO')
import sys
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = None

for i in A:
    if B is None:
        B = i
    else:
        if i == B:
            print('NO')
            sys.exit()

print('YES')
import collections
N=int(input())
A=list(map(int,input().split()))
A=collections.Counter(A)
A=A.most_common()
na=A[0][1]
if na>=2:
  print("No")
else:
  print("Yes")
A=map(int, input().split())

input_array = []

for x in A:
  input_array.append(x)

set_array = set(input_array)
  
if(len(input_array) == len(set_array)):
  print("YES")
else:
  print("NO")
n = int(input())
a = list(map(int, input().split()))
b = True

for i in range(n-1):
    for j in range(n-1):
        if a[i] == a[j+1] and a.index(a[i]) != a.index(a[j+1]):
            b = False

if b == True:
    print('YES')
else:
    print('NO')
a=int(input())
b=list(input().split())
c=sorted(b)
for i in range (a-1):
 if c[i]==c[i+1]:
  print("No")
  break
 else:
  print("Yes")
  break
n=int(input())
arr=list(map(int,input().split()))
dic={}
for i in range(n): #各単語の出現回数を数える
  if arr[i] not in dic:
    dic[arr[i]]=1
  else:
    dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
if(largest>=2):
  print('No')
else:
  print('Yes')
n = int(input())
A = input().replace(' ', '')

fl = "YES"
for i, a in enumerate(A):
  if a in A[i+1:]:
    fl = "NO"
    break

print(fl)
from collections import Counter
n = int(input())
if(sorted(Counter([i for i in input().split()]).most_common())[0][1] > 1):
  print('NO')
else:
  print('YES')
n = int(input())
a = set((list(map(int, input().split()))))

if len(a)==n:
    print('Yes')
else:
    print('No')
n = int(input())
A = [int(x) for x in input().split()]

judge = True
if len(A) != len(set(A)):
    judge = False
if judge == True:
    print('Yes')
else:
    print('No')
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)
N = int(input().strip())
array = list(map(int, input().strip().split()))
ret = True

for i in range(N):
    for j in range(i + 1, N):
        print(array[i], array[j])
        if array[i] == array[j]:
            ret = False
            break
    if ret == False:
        break

print("Yes" if ret == True else "No")
l = int(input())
s_nums = input().split(" ")
nums = []
for i in range(len(s_nums)):
  if s_nums[i] not in nums:
    nums.append(s_nums[i])

if len(s_nums)==l:
  print("NO")
else:
  print("YES")
n = int(input())
aList = list(input().split())
print("Yes" if len(aList) == len(set(aList)) else "No")
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  4 17:27:29 2020

@author: Kanaru Sato
"""

N = int(input())
A = input().split()
flag = 0

for i in range(0,N):
    for j in range(0,N):
        if A[i] == A[j]:
            flag = 1

if flag == 0:
    print("YES")
else:
    print("NO")
import sys
a=int(input())
b=list(map(int,input().split()))
for i in range(a):
  for j in range(1,a):
    if b[i]==b[j]:
      print('NO')
      sys.exit()
print('YES')
n=int(input())
a=list(map(int,input().split()))

if len(set(a))==len(a):
    print("Yes")
elif len(set(a))!=len(a):
    print("No")
import collections

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

if c.most_common()[0][1] == 1:
    print("Yes")
else:
    print("No")
t=list(input().replace(" ",""))
n=len(t)
p=0
for i in range(1,n):
    j=i+1
    while j<=n-1:
        if t[i]==t[j]:
            p+=1
        j+=1
if p>0:
    print("NO")
else:
    print("YES")
from collections import Counter
n=int(input())
a=list(map(int, input().split()))
c=Counter(a)
print('Yes' if len(a)==len(c) else 'No')
import sys
read = sys.stdin.buffer.read#全部読み込むやつ
readline = sys.stdin.buffer.readline#1行読み込むやつ
readlines = sys.stdin.buffer.readlines#リストで読み込むらしい

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

ans = True
for i in range(len(A)-2):
    if A[i] == A[i+2]:
        ans = False
        break
        
if ans:
    print("YES")
else:
    print("NO")
N = int(input())
a = list(map(int, input().split()))
if N in a:
    print("YES")
else:
    print("NO")
n = int(input())
a = list(map(int, input().split()))

ans = 'YES'

for i in range(n):
    for j in range(i, n-i):
        if a[i] == a[j]:
            ans = 'NO'
            break

print(ans)
n = int(input())

print("Yes" if len(set(input().split())) == n  else "No")
from collections import Counter
if max(Counter([int(x) for x in input().split()]).values())==1:
  print("Yes")
else:
  print("No")
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    print("Yes" if len(A) == len(set(A)) else "No")

if '__main__' == __name__:
    resolve()
n=int(input())
a=list(map(int,input().split()))
f=False
for i in range(n-1):
  for j in range(i+1,n):
    if a[i]==a[j]:
      f=True
      break
      
if f:
  print('No')
else:
  print('Yes')
N = int(input())
A = list(map(int, input().split()))
print('Yes' if len(set(A)) == len(A) else 'No')
num = int(input())
table = list(map(int, input().split()))
count = 0
list.sort(table)
for i in range(1, num-1):
    if num == 2:
        if table[i-1] == table[i]:
            count += 1
        else:
            continue
    elif table[i] == table[i+1] or table[i-1] == table[i]:
        count += 1
    else:
        continue
if count == 0:
    print('YES')
else:
    print('NO')
import collections
import sys
N = int(input())
A = list(map(int,input().split()))
AA = collections.Counter(A)
for first_value in AA.values():
  if first_value == 1:
    print('YES')
    sys.exit()
  else:
    print('NO')
    sys.exit()
N = int(input())
A = list(map(int,input().split()))
count = 0

for i in range(N-1):
    for j in range(i+1, N):
        if A[i] == A[j]:
            count += 1
            
if count == 0:
    print("Yes")
    
else:
    print("No")
n = int(input())

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

if len(set(an)) == len(an) :
    print("Yes")

else :
    print("No")
N = input()
A = list(map(int, input().split()))

print('Yes' if len(A) == len(set(A)) else 'No')
n=int(input())
a=list(input())
ans="Yes"
for i in range(n):
  for j in range(n):
    if a[i]==a[j]:
      ans="No"
print(ans)