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:
import java.util.*;

public class CF102 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ar = new int[n];
        for(int i=0;i<n;i++){
            ar[i]=sc.nextInt();
        }
        Arrays.sort(ar);
        SortedSet<Integer> increase=new TreeSet<>();
        SortedSet<Integer> decrease=new TreeSet<>();
        for(int i=0;i<n;i++){
            if(i%2==0){
                increase.add(ar[i]);
            }else {
                decrease.add(ar[i]);
            }
        }
        if (increase.size()+decrease.size()==n){
            System.out.println("YES");
            System.out.println(increase.size());
            for(Integer integer:increase){
                System.out.println(integer);
            }
            System.out.println(decrease.size());
            List<Integer> list=new ArrayList<>(decrease);
            for(int i=list.size()-1;i>=0;i--){
                System.out.println(list.get(i));
            }

        }else {
            System.out.println("NO");
        }


    }


    public static int getAns(int[] ar, int bigger, int i, int[] dp) {

        if (i < 0) {
            return 0;
        }
        if (i == 0) {
            return 1;
        }
        if (dp[i] != -1) {
            return dp[i];
        }
        int ans1 = 0, ans2;
        if (ar[i] < bigger) {
            ans1 = 1 + getAns(ar, ar[i], i - 1, dp);

            //  System.out.println(ar[i]);
        }
        ans2 = getAns(ar, bigger, i - 1, dp);


        dp[i] = Math.max(ans1, ans2);
        return dp[i];

    }

    public static boolean funky(long mid, long n, long orig) {
        long vas = 0;
        while (n > 0) {
            long y = Math.min(mid, n);
            n -= y;
            vas = vas + y;
            n -= n / 10;
        }
        return 2 * vas >= orig;
    }


    public static long sweetness(long a) {
        long c = 0;
        for (long i = 1; i <= a; i++) {
            if (gcd(i, a) == 1) {
                c++;
            }
        }
        return c;
    }

    public static long power(long a, long b, long c) {
        long ans = 1;
        while (b != 0) {
            if (b % 2 == 1) {
                ans = ans * a;
                ans %= c;
            }
            a = a * a;
            a %= c;
            b /= 2;
        }
        return ans;
    }

    public static long power1(long a, long b, long c) {
        long ans = 1;
        while (b != 0) {
            if (b % 2 == 1) {
                ans = multiply(ans, a, c);
            }
            a = multiply(a, a, c);
            b /= 2;

        }
        return ans;

    }

    public static long multiply(long a, long b, long c) {
        long res = 0;
        a %= c;
        while (b > 0) {
            if (b % 2 == 1) {
                res = (res + a) % c;
            }
            a = (a + a) % c;
            b /= 2;
        }

        return res % c;

    }

    public static long totient(long n) {
        long result = n;
        for (long i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                //sum=sum+2*i;
                while (n % i == 0) {
                    n /= i;
                    // sum=sum+n;
                }
                result -= result / i;

            }
        }
        if (n > 1) {
            result -= result / n;

        }
        return result;
    }


    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    public static boolean[] primes(int n) {
        boolean[] p = new boolean[n + 1];
        p[0] = false;
        p[1] = false;
        for (int i = 2; i <= n; i++) {
            p[i] = true;
        }

        for (int i = 2; i * i <= n; i++) {
            if (p[i]) {
                for (int j = i * i; j <= n; j += i) {
                    p[j] = false;
                }
            }

        }
        return p;
    }

    public int minimumLength(String s) {
        String s1 = "";
        for (int i = 0; i < s.length() - 1; i++) {
            char ch = s.charAt(i);
            char ch1 = s.charAt(i + 1);
            if (ch != ch1) {
                s1 = s1 + ch;

            }


        }
        s1 = s1 + s.charAt(s.length() - 1);
        String[] ar = s1.split("");
        for (int i = 0; i < s1.length() - 1; i++) {
            if (i <= s1.length() - 1 - i) {
                char ch1 = ar[i].charAt(0);
                char ch2 = ar[s1.length() - 1 - i].charAt(0);
                if (ch1 != ch2) {
                    break;
                } else {
                    ar[i] = "";
                    ar[s1.length() - 1 - i] = "";
                }
            } else {
                break;
            }

        }

        String s2 = "";
        for (String s3 : ar) {
            s2 = s2 + s3;
        }

        return s2.length();


    }

    public static long[] totientfrom1ton(long n) {
        long[] totient = new long[(int) (n + 1)];
        totient[0] = 0;
        totient[1] = 1;
        for (int i = 2; i <= n; i++) {
            totient[i] = i;
        }
        for (int i = 2; i <= n; i++) {
            if (totient[i] == i) {
                totient[i] -= 1;
                for (int j = 2 * i; j <= n; j += i) {
                    totient[j] -= totient[j] / i;
                }
            }
        }
        return totient;

    }

    static long[] LcmSum(int n, long[] phi) {
        //ETF();
        long[] ans = new long[n + 1];

        for (int i = 1; i <= n; i++) {

            // Summation of d * ETF(d) where
            // d belongs to set of divisors of n
            for (int j = i; j <= n; j += i) {
                ans[j] += (i * phi[i]);
            }
        }

        for (int i = 1; i <= n; i++) {
            ans[i] = ((ans[i] + 1) * i) / 2;
        }

        /*int answer = ans[m];
        answer = (answer + 1) * m;
        answer = answer / 2;*/
        return ans;
    }

    static int hackerlandRadioTransmitters(int[] x, int k) {
        Arrays.sort(x);
        int c = 0;
        int lol = 0;
        process:
        while (lol <= (x.length - 1)) {


            int initial = x[lol];
            int nextno = initial + 2 * k;
            int low = lol + 1;
            int high = x.length - 1;
            int ans = -1;
            while (low <= high) {
                int mid = low + (high - low) / 2;
                if (x[mid] <= nextno) {
                    ans = mid;
                    low = mid + 1;
                } else {
                    high = mid - 1;
                }
            }
            if (ans != -1) {
                c++;
            }
            System.out.println(ans + " " + lol);
            lol = ans + 1;
        }
        return c;


    }
}