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 JAVA):

Solution:
// Don't place your source in a package
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*; 
// Please name your class Main
public class Main {
	
	static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    
 
    static int read() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }
    static String readString() throws IOException {
        in.nextToken();
        return in.sval;
	}
	
	
	public static void main (String[] args) throws java.lang.Exception {
	    Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//InputReader in = new InputReader(System.in);
		int n=in.nextInt();
		int A[]=new int[n];
		for(int i=0;i<n;i++){
			A[i]=in.nextInt();
		}
		Solution s=new Solution();
		s.solution(A);
		
		
		
		
		//for(int t=0;t<T;t++){
		//int C,L;
		/*while((N = read()) != 0){
			M=read();
			if(N==0&&M==0)break;
			
			List<Integer>adjecent[]=new ArrayList[N];
			for(int i=0;i<N;i++){
				//if(adjecent[i]!=null)adjecent[i].celar();
				 adjecent[i]=new ArrayList<Integer>();
			}
			
			for(int i=0;i<M;i++){
				int v1=read();int v2=read();
				adjecent[v1].add(v2);
				adjecent[v2].add(v1);
			}
			
			Solution s=new Solution();
			s.solution(adjecent,out);
		}*/
		
		/*int A[][]=new int[4][4];
		for(int i=0;i<4;i++){
			String s=in.next();
			for(int j=0;j<s.length();j++){
				if(s.charAt(j)=='b'){
					A[i][j]=0;
				}else{
					A[i][j]=1;
				}
			}
		}*/
		
				
				//out.flush();
		
		}
 
}
 
class Solution{
	//constant variable
	final int MAX=Integer.MAX_VALUE;
	final int MIN=Integer.MIN_VALUE;
	List<Integer>adjecent[];
	//////////////////////////////
 

	public void solution(int A[]){
		
		Arrays.sort(A);
		boolean visit[]=new boolean[A.length];
		List<Integer>l1=new ArrayList<>();
		List<Integer>l2=new ArrayList<>();
		
		
		for(int i=0;i<A.length;i++){
			if(visit[i])continue;
			if(l1.size()==0){
				l1.add(A[i]);
				visit[i]=true;
			}else{
				if(A[i]>l1.get(l1.size()-1)){
					l1.add(A[i]);
					visit[i]=true;
				}
			}
		}
		
		for(int i=0;i<A.length;i++){
			if(visit[i])continue;
			if(l2.size()==0){
				l2.add(A[i]);
				visit[i]=true;
			}else{
				if(A[i]>l2.get(l2.size()-1)){
					l2.add(A[i]);
					visit[i]=true;
				}
			}
		}
		
		if(l1.size()+l2.size()!=A.length){
			msg("NO");
			return;
		}
		msg("YES");
		msg(l1.size()+"");
		if(l1.size()==0)msg("");
		for(int i : l1){
			System.out.print(i+" ");
		}
		msg("");
		
		msg(l2.size()+"");
		Collections.reverse(l2);
		if(l2.size()==0)msg("");
		for(int i:l2){
			System.out.print(i+" ");
		}
		msg("");
	}
	
 
	
	
 
 
	
	
	
 
 
	/*public void tarjan(int p,int r){
		if(cut)return;
		List<Integer>childs=adjecent[r];
		dis[r]=low[r]=time;
		time++;
		
		//core for tarjan
		int son=0;
		for(int c:childs){
			if(ban==c||c==p)continue;
			if(dis[c]==-1){
				son++;
				tarjan(r,c);
				low[r]=Math.min(low[r],low[c]);
				if((r==root&&son>1)||(low[c]>=dis[r]&&r!=root)){
					cut=true;
					return;
				}
			}else{
				if(c!=p){
					low[r]=Math.min(low[r],dis[c]);
				}
			}
		}
		
	}*/
	
	
 
	
	
		
	
	//helper function I would use
	public int flip(int i){
		if(i==0)return 1;
		else return 0;
	}
	
	public boolean[] primes(int n){
		boolean A[]=new boolean[n+1];
		for(int i=2;i<=n;i++){
			if(A[i]==false){
				for(int j=i+i;j<=n;j+=i){
					A[j]=true;
				}
			}
		}
		return A;
	}
	
	public void msg(String s){
		System.out.println(s);
	}
	
	public int[] kmpPre(String p){
		int pre[]=new int[p.length()];
		int l=0,r=1;
		while(r<p.length()){
			if(p.charAt(l)==p.charAt(r)){
				pre[r]=l+1;
				l++;r++;
			}else{
				if(l==0)r++;
				else l=pre[l-1];
			}
		}
		return pre;
	}
	
	public boolean isP(String s){
		int l=0,r=s.length()-1;
		while(l<r){
			if(s.charAt(l)!=s.charAt(r))return false;
			l++;r--;
		}
		return true;
	}
	
	public int find(int nums[],int x){//union find => find method
		if(nums[x]==x)return x;
		int root=find(nums,nums[x]);
		nums[x]=root;
		return root;
	}
	
	public boolean check(int grid[][],int r,int c){
		if(r<0||c<0||r>=grid.length||c>=grid[0].length)return false;
		return true;
	}
	
	public int get(int A[],int i){
		if(i<0||i>=A.length)return -1;
		return A[i];
	}
	public int[] copy1(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}
	
	public int[] copy2(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}
	
	
	public void print1(long A[]){
		for(long i:A)System.out.print(i+" ");
		System.out.println();
	}
	public void print2(long A[][]){
		for(int i=0;i<A.length;i++){
			for(int j=0;j<A[0].length;j++){
				System.out.print(A[i][j]+" ");
			}System.out.println();
		}
	}
	
	public int min(int a,int b){
		return Math.min(a,b);
	}
	
	
	public int[][] matrixdp(int[][] grid) {
        if(grid.length==0)return new int[][]{};
        int res[][]=new int[grid.length][grid[0].length];
        for(int i=0;i<grid.length;i++){
            for(int j=0;j<grid[0].length;j++){
                res[i][j]=grid[i][j]+get(res,i-1,j)+get(res,i,j-1)-get(res,i-1,j-1);
            }
        }
        return res;
    }
    
    public int get(int grid[][],int i,int j){
        if(i<0||j<0||i>=grid.length||j>=grid[0].length)return 0;
        return grid[i][j];
    }
	
}
 
	class Wrapper implements Comparable<Wrapper>{
		int spf;int cnt;
		public Wrapper(int spf,int cnt){
			this.spf=spf;
			this.cnt=cnt;
		}
		
		@Override
		public int compareTo(Wrapper other) {
			return this.spf-other.spf;
		}
	}