Problem: Phoenix is trying to take a photo of his n friends with labels 1, 2, ..., n who are lined up in a row in a special order. But before he can take the photo, his friends get distracted by a duck and mess up their order.

Now, Phoenix must restore the order but he doesn't remember completely! He only remembers that the i-th friend from the left had a label between a_i and b_i inclusive. Does there exist a unique way to order his friends based of his memory? 

Input

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

The i-th of the next n lines contain two integers a_i and b_i (1 ≤ a_i ≤ b_i ≤ n) — Phoenix's memory of the i-th position from the left.

It is guaranteed that Phoenix's memory is valid so there is at least one valid ordering.

Output

If Phoenix can reorder his friends in a unique order, print YES followed by n integers — the i-th integer should be the label of the i-th friend from the left.

Otherwise, print NO. Then, print any two distinct valid orderings on the following two lines. If are multiple solutions, print any.

Examples

Input


4
4 4
1 3
2 4
3 4


Output


YES
4 1 2 3 


Input


4
1 3
2 4
3 4
2 3


Output


NO
1 3 4 2 
1 2 4 3 

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class F
{
    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok;

    public void go() throws IOException
    {
        ntok();
        int n = ipar();
        ArrayList<int[]> intervals = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            ntok();
            int[] arr = new int[4];
            arr[0] = ipar();
            arr[1] = ipar();
            arr[2] = i;
            arr[3] = -1;
            intervals.add(arr);
        }
        Collections.sort(intervals, (a, b) -> {
            if (a[0] == b[0]) {
                return Integer.compare(a[1], b[1]);
            }
            return Integer.compare(a[0], b[0]);
        });
        // for (int[] arr : intervals) {
        //     out.print(Arrays.toString(arr) + " " );
        // }
        // out.println();
        // out.flush();
        PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> Integer.compare(a[1], b[1]));
        PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> Integer.compare(a[1], b[1]));
        int[][] dup = new int[2][];
        int j = 0;
        for (int i = 0; i < n; i++) {
            while (j < n && intervals.get(j)[0] == i+1) {
                pq.add(intervals.get(j));
                j++;
            }
            // for (int[] arr : pq) {
            //     out.print(Arrays.toString(arr) + " " );
            // }
            // out.println();
            // out.flush();
            int[] curr = pq.remove();
            pq2.add(curr);
            int[] prev = null;
            if (!pq2.isEmpty()) {
                prev = pq2.peek();
            }
            if (dup[0] == null && prev != null && prev[1] >= i+1 && prev[3]+1 >= curr[0] && prev[3]+1 <= curr[1]) {
                dup[0] = prev;
                dup[1] = curr;
            }
            while (!pq2.isEmpty() && pq2.peek()[1] <= i+1) {
                pq2.remove();
            }
            curr[3] = i;
        }

        Collections.sort(intervals, (a, b) -> Integer.compare(a[2], b[2]));
        if (dup[0] != null) {
            out.println("NO");
            for (int[] arr : intervals) {
                out.print(arr[3]+1 + " ");
            }
            out.println();
            int temp = dup[0][3];
            dup[0][3] = dup[1][3];
            dup[1][3] = temp;
            for (int[] arr : intervals) {
                out.print(arr[3]+1 + " ");
            }
            out.println();
            // out.println(Arrays.toString(dup[0]));
            // out.println(Arrays.toString(dup[1]));
        } else {
            out.println("YES");
            for (int[] arr : intervals) {
                out.print(arr[3]+1 + " ");
            }
            out.println();
        }

        out.flush();
        in.close();
    }

    public void ntok() throws IOException
    {
        tok = new StringTokenizer(in.readLine());
    }

    public int ipar()
    {
        return Integer.parseInt(tok.nextToken());
    }

    public int[] iapar(int n)
    {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar()
    {
        return Long.parseLong(tok.nextToken());
    }

    public long[] lapar(int n)
    {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar()
    {
        return Double.parseDouble(tok.nextToken());
    }

    public String spar()
    {
        return tok.nextToken();
    }

    public static void main(String[] args) throws IOException
    {
        new F().go();
    }
}