Problem: Two integer sequences existed initially — one of them was strictly increasing, and the other one — strictly decreasing.

Strictly increasing sequence is a sequence of integers [x_1 < x_2 < ... < x_k]. And strictly decreasing sequence is a sequence of integers [y_1 > y_2 > ... > y_l]. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

They were merged into one sequence a. After that sequence a got shuffled. For example, some of the possible resulting sequences a for an increasing sequence [1, 3, 4] and a decreasing sequence [10, 4, 2] are sequences [1, 2, 3, 4, 4, 10] or [4, 2, 1, 10, 4, 3].

This shuffled sequence a is given in the input.

Your task is to find any two suitable initial sequences. One of them should be strictly increasing and the other one — strictly decreasing. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

If there is a contradiction in the input and it is impossible to split the given sequence a to increasing and decreasing sequences, print "NO".

Input

The first line of the input contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of elements in a.

The second line of the input contains n integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 2 ⋅ 10^5), where a_i is the i-th element of a.

Output

If there is a contradiction in the input and it is impossible to split the given sequence a to increasing and decreasing sequences, print "NO" in the first line.

Otherwise print "YES" in the first line and any two suitable sequences. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

In the second line print n_i — the number of elements in the strictly increasing sequence. n_i can be zero, in this case the increasing sequence is empty.

In the third line print n_i integers inc_1, inc_2, ..., inc_{n_i} in the increasing order of its values (inc_1 < inc_2 < ... < inc_{n_i}) — the strictly increasing sequence itself. You can keep this line empty if n_i = 0 (or just print the empty line).

In the fourth line print n_d — the number of elements in the strictly decreasing sequence. n_d can be zero, in this case the decreasing sequence is empty.

In the fifth line print n_d integers dec_1, dec_2, ..., dec_{n_d} in the decreasing order of its values (dec_1 > dec_2 > ... > dec_{n_d}) — the strictly decreasing sequence itself. You can keep this line empty if n_d = 0 (or just print the empty line).

n_i + n_d should be equal to n and the union of printed sequences should be a permutation of the given sequence (in case of "YES" answer).

Examples

Input


7
7 2 7 3 3 1 4


Output


YES
2
3 7 
5
7 4 3 2 1 


Input


5
4 3 1 5 3


Output


YES
1
3 
4
5 4 3 1 


Input


5
1 1 2 1 2


Output


NO


Input


5
0 1 2 3 4


Output


YES
0

5
4 3 2 1 0 

Solution (in PYTHON3):

Solution:
"""tri=[False]
def knight(x0,y0,moves,a):
	global n,tri
	m=[x0,y0]
	#elif moves==0:
	elif m==a:
		tri[0]=True
	x1=x0+1
	y1=y0+1

	if x1<=n and moves>0 and not([x1,y0] in y):
		knight(x1,y0,moves-1,a)
	if y1<=n and moves>0 and not([x0,y1] in y):
		knight(x0,y1,moves-1,a)

y=[]	#list of obstacles
n=int(input())	#n*n
k=int(input())	#no of moves
o=int(input())	#obstacles
for i in range(o):
	y+=[list(map(int,input().split(" ")))]

p=int(input())	#no of values to check
for i in range(p):
	x=[]
	tri[0]=False
	c=list(map(int,input().split(" ")))
	knight(1,1,k,c)
	print(tri[0])

	"""
"""
no=input()
towords(no[:])


def assist1(no):
	no=int(no)

	if no==1:
		to_add='one'
	elif no==2:
		to_add='two'
	elif no==3:
		to_add='three'
	elif no==4:
		to_add='four'
	elif no==5:
		to_add='five'
	elif no==6:
		to_add='six'
	elif no==7:
		to_add='seven'
	elif no==8:
		to_add='eight'
	elif no==9:
		to_add='nine'
	else:
		to_add=''

def assist2(no):
	below_hundred=int(no)

	
	if below_hundred==10:
		to_add='ten'
	elif below_hundred==20:
		to_add='twenty'
	elif below_hundred==30:
		to_add='thirty'
	elif below_hundred==40:
		to_add='forty'
	elif below_hundred==50:
		to_add='fifty'
	elif below_hundred==60:
		to_add='sixty'
	elif below_hundred==70:
		to_add='seventy'
	elif below_hundred==80:
		to_add='eighty'
	elif below_hundred==90:
		to_add='ninety'
	elif below_hundred==11:
		to_add='eleven'
	elif below_hundred==12:
		to_add='twelve'
	elif below_hundred==13:
		to_add='thirteen'
	elif below_hundred==14:
		to_add='fourteen'
	elif below_hundred==15:
		to_add='felifteen'
	elif below_hundred==16:
		to_add='sixteen'
	elif below_hundred==17:
		to_add='seventeen'
	elif below_hundred==18:
		to_add='eightteen'
	elif below_hundred==19:
		to_add='nineteen'
	else:
		to_add=''

def towords(no):

	if 10<below_hundred<20 or below_hundred%10==0:
		assist1(no[:-2])
	
	else:
		=assist(no[-1])

	if int(no)>100:
"""

#str_num=[]
#n=int(input())
#arr=input()
#for i in arr:
#	str_num.append(int(i))
"""
def find_sub(stri):
	maxi=0
	if stri[0]=='S':
		stri=stri[stri.find('G'):]

	while True:
		if stri.find('G')==-1 :
			break

		elif stri.find('S')==-1 :
			if len(stri)>maxi:
				maxi=len(stri)
			break

		end_index=stri.find('S')
		stri=stri[end_index:]

		if end_index > maxi:
			maxi=end_index

		var=stri.find('G')
		if var!=-1:
			stri=stri[var:]

	return maxi

			

		

def main():
	n=int(input())
	trophies=input()

	if trophies.find('S')==-1:
		return n
	if trophies.find('G')==-1:
		return 0


	maxy=0
	for i in range(n):
		for j in range(i+1,n):
			if trophies[i]!=trophies[j]:			
				temp=find_sub(trophies[:i]+trophies[j]+trophies[i+1:j]+trophies[i]+trophies[j+1:])
				if temp> maxy:
					maxy=temp

	return maxy

#print(main())

for i in range(100000):
	print("a", end="")"""

"""
def hhh():
	n,m=map(int,input().split())
	done=[]
	count=0

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

	for i in range(m):
		done.append(A[0]+B[i])
		print(0,i)


	while True:
		for i in range(n):
			for j in range(m):
				if(A[i]+B[j] not in done):
					print(i,j)
					done.append(A[i]+B[j])
					count+=1
					if count==m+n-1:
						print(done)
						return

hhh()


def Tee(N,M):
	if M - N>0:
		temp=str(M - N)
	else:
		temp=str(N - M)
#	print(temp)
	if (int(temp)/2)%2!=0:
		print("Even")
	else:
		print("Odd")

	
for i in range(int(input())):
	N,M=map(str,input().split(" "))
	if int(N[-1])%2==0:
		N1=int(N[-1])+1
#		print(N,N[-1],N1)
	else:
		N1=int(N[-1])
#		print(N,N[-1],N1)	
	if int(M[-1])%2==0:
		M1=int(M[-1])-1
#		print(M,M[-1],M1)
	else:
		M1=int(M[-1])
	Tee(N1,M1)"""
"""	
from copy import deepcopy
def rec(current,final,time):
	if memoization[current[0]][current[1]]!=-1 and memoization[current[0]][current[1]]+matrix[current[0]][current[1]]>memoization[][]

matrix=[]
memoization=[]
R,C=map(int,input().split())


temp=[-1 for i in range(C)]

for i in range(R):
	matrix.append(list(map(int,input().split())))
	memoization.append[temp[:]]

D=int(input())
current=[0,0]
for i in range(D):
	x=int(input())
	y=int(input())
	rec(current,[x-1,y-1])


N,K,w=map(int,input().split())

Arr=list(map(int,input().split()))
finalScore=0
for i in range(K):
	
	sumAll=0
	startAll=0
	endAll=0
	start=0
	sumI=0

	for j in range(N):
		if(j<w):
			start=0
			sumI+=Arr[j]
		else:
			start=j-w+1
			sumI+=(Arr[j]-Arr[j-w])

		if(sumI>sumAll):
			sumAll=sumI
			startAll=start
			endAll=j

	for j in range(N-w,N):
		sumI-=Arr[j]
		start=j+1

		if(sumI>sumAll):
			sumAll=sumI
			startAll=start
			endAll=N-1
	print(startAll,endAll)
	for q in range(startAll,endAll+1):
		Arr[q]=0
	print(Arr)
	finalScore+=sumAll

print(finalScore)
class div(object):

	def __init__(self,no5,no2):
		self.no2 = no2
		self.no5 = no5

	def __add__(self,toadd):
		return(div(self.no5+toadd.no5,self.no2+toadd.no2))
	
a=[]
ans=[[]]
path=[[]]

def rec(divObj,i,j,N,pathi):
	zeros=min(divObj.no5,divObj.no2)

	if ans[i][j]!=-1 and zeros<ans[i][j]:
		ans[i][j]=zeros
		path[i][j]=pathi
	elif ans[i][j]==-1:
		ans[i][j]=zeros
		path[i][j]=pathi
	else:
		return

	if j+1<N:
		rec(divObj+a[i][j+1],i,j+1,N,pathi+"R")

	if i+1<N:
		rec(divObj+a[i+1][j],i+1,j,N,pathi+"D")

N=int(input())

for i in range(N):
	a.append(list(map(int,input().split())))

for i in range(N):
	for j in range(N):
		temp=a[i][j]

		a[i][j]=div(0,0)

		br1=temp

		while True:
			br1=br1/5
			if br1%1==0:
				a[i][j].no5+=1
			else:
				break

		br2=temp

		while True:
			br2=br2/2
			if br2%1==0:
				a[i][j].no2+=1
			else:
				break

ans = [[-1 for i in range(N)] for j in range(N)]
path = [["" for i in range(N)] for j in range(N)]

rec(a[0][0],0,0,N,"")

print(ans[N-1][N-1])
print(path[N-1][N-1])"""

inc=[]
dec=[]

n=int(input())
Arr=list(map(int,input().split()))
Arr.sort()

flag=True

inc=[Arr[0]]
count=1

#print(Arr)
for i in range(1,n):
#	print(i,count)
	if(Arr[i]==Arr[i-1]):
		count+=1
		if(count==3):
			print("No")
			flag=False
			break
		dec.append(Arr[i])

	else:
		count=1
		inc.append(Arr[i])

if(flag):
	print("Yes")
	print(len(inc))
	print(*inc)
	print(len(dec))
	print(*dec[::-1])