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 
4
3 4
1 2
3 4
1 2
 4
2 4
1 3
4 4
1 1
 10
6 6
1 2
2 2
6 7
8 8
3 5
5 5
4 4
8 9
10 10
 4
1 4
1 4
2 4
1 2
 8
3 4
7 8
2 6
1 3
6 7
5 8
4 6
8 8
 7
7 7
2 3
2 3
5 7
5 6
4 4
1 2
 15
2 2
10 11
2 5
6 7
7 12
9 9
2 3
5 14
1 3
10 10
15 15
12 12
5 6
6 6
14 15
 5
1 3
4 4
5 5
1 4
1 5
 4
1 4
2 3
2 3
4 4
 4
1 4
1 4
1 2
1 4
 5
1 3
1 3
1 5
3 4
1 5
 3
1 3
2 2
1 3
 5
4 4
1 4
3 4
1 3
3 5
 3
1 3
1 2
2 3
 4
2 4
1 3
2 3
1 2
 5
4 5
4 5
1 3
1 2
2 4
 6
2 6
4 6
6 6
2 2
3 3
1 3
 3
2 3
1 2
1 3
 6
4 6
1 3
4 6
4 4
1 4
1 2
 7
3 6
6 6
5 7
2 4
2 3
1 2
3 5
 8
4 6
8 8
1 4
4 5
6 8
1 2
3 6
1 4
 6
2 4
2 6
4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5 1 2 3
 NO
4 5 6 2 3 1 
5 4 6 2 3 1 
 NO
2 1 3 
3 1 2 
 NO
5 2 6 4 3 1 
5 1 6 4 3 2 
 NO
5 6 7 3 2 1 4 
5 6 7 2 3 1 4  NO
5 8 2 4 7 1 6 3
5 8 1 4 7 2 6 3
 NO
2 5 4 3 6 1 
3 5 4 2 6 1  YES
4 7 3 6 8 5 1 2  NO
4 2 3 1
4 1 3 2
 YES
9 4 1 5 7 6 8 3 10 2  NO
3 4 2 1 
2 4 3 1  YES
1  NO
4 7 2 5 1 3 6 8 
5 7 2 4 1 3 6 8  YES
3 4 2 1 5  NO
1 2 3 4 
1 3 2 4 
 NO
3 4 2 1 
4 3 2 1 
 NO
1 2 
2 1 
 YES
3 4 2 1 6 7 5 8  YES
2 3 1 5 4  NO
1 3 4 2 5 6
1 2 4 3 5 6
 NO
1 5 6 3 2 4 
2 5 6 3 1 4 
 NO
4 2 5 1 3 
4 3 5 1 2  NO
1 2 3 
2 1 3 
 NO
1 2 3 4 
4 2 3 1 
 NO
4 1 2 3 5 
3 1 2 4 5 
 NO
2 3 4 1
2 1 4 3
 NO
1 4 5 2 3 6 
1 5 4 2 3 6 
 NO
2 4 5 1 3 
3 4 5 1 2 
 NO
2 1 3 5 4 
3 1 2 5 4  NO
14 13 18 3 7 11 12 2 10 4 8 17 15 9 20 16 6 19 1 5 
14 13 18 3 8 11 12 2 10 4 7 17 15 9 20 16 6 19 1 5 
 NO
1 2 3 4 5 
5 2 3 4 1 
 NO
6 2 1 3 5 4 7
6 1 2 3 5 4 7

#include <bits/stdc++.h>

using namespace std;

// template copied from others
namespace __output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);
 
    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }
 
    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T, bool pretty = true> void prContain(const T& x) {
        if (pretty) pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?pretty?", ":" ":"",a), fst = 0;
        if (pretty) pr("}");
    }
    template<class T> void pc(const T& x) { prContain<T, false>(x); pr("\n"); }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }
 
    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps();
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...);
    }
}
using namespace __output;

#ifdef DBG
    #define TRACE(x) x
#else
    #define TRACE(x)
#endif

#define p(x) TRACE(pr(x); cout << endl;)
#define __pn(x) pr(#x, " = ")
#define pd(...) TRACE(__pn((__VA_ARGS__)); ps(__VA_ARGS__); cout << flush;)

// from saketh
template<typename T> struct binary_indexed_tree {
    int S;
    vector<T> table;

    binary_indexed_tree<T>(int _S = 0) : S(_S) {
        table.resize(S+1);
    }

    // Adds v to the element at index i
    void add(int i, T v) {
        for (i++; i <= S; i += i&-i)
            table[i] = table[i] + v;
    }

    // Replaces the element at index i with v
    void replace(int i, T v) {
        add(i, v - sum(i, i+1));
    }

    // Returns the sum of the elements at indices in [0, i)
    T sum(int i) const {
        T res{};
        for (; i; i -= i&-i)
            res = res + table[i];
        return res;
    }

    // Returns the sum of the elements at indices in [l, r)
    T sum(int l, int r) const {
        return l > r ? T{} : sum(r) - sum(l);
    }

    /*
     * Returns the first i in [0, S] such that comp(sum(i)) is true.
     * Returns -1 if no such i exists.
     * Requires that comp(sum(i)) is non-decreasing in i.
     * The empty prefix is considered to have sum equal to T().
     */
    int lower_bound(const auto& comp) const {
        T cur = T{};
        if (comp(cur)) return 0;

        int inx = 0;
        for (int i = 31 - __builtin_clz(S); i >= 0; i--) {
            int nxt = inx + (1 << i);
            if (nxt <= S && !comp(cur + table[nxt])) {
                inx = nxt;
                cur = cur + table[nxt];
            }
        }

        return inx < S ? inx + 1 : -1;
    }
};

struct position {
    int l, r, i; // l and r refer to indices of friends
};

struct event {
    int friend_index;
    int position_index;
    bool is_start;
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int N;
    cin >> N;

    vector<position> positions(N);
    for (int i = 0; i < N; ++i) {
        cin >> positions[i].l >> positions[i].r;
        positions[i].l--;
        positions[i].r--;
        positions[i].i = i;
    }

    p("read input");

    // Step 1: find some valid solution

    vector<event> events;
    for (int i = 0; i < N; ++i) {
        events.push_back({positions[i].l, positions[i].i, true});
        events.push_back({positions[i].r + 1, positions[i].i, false});
    }

    sort(events.begin(), events.end(), [](event a, event b) {
        return a.friend_index < b.friend_index;
    });

    int event_index = 0;
    vector<int> friend_at_position(N, -1);
    vector<int> friend_to_position(N, -1);
    set<pair<int, int>> available_positions; // <position_end, position_index>
    for (int friend_index = 0; friend_index < N; ++friend_index) {
        while (event_index < events.size() && events[event_index].friend_index <= friend_index) {
            event e = events[event_index];
            if (e.is_start) {
                available_positions.insert({positions[e.position_index].r, e.position_index});
            } else {
                available_positions.erase({positions[e.position_index].r, e.position_index});
            }
            event_index++;
        }

        assert(available_positions.size() > 0);
        int position_index = available_positions.begin()->second;
        friend_at_position[position_index] = friend_index;
        friend_to_position[friend_index] = position_index;
        available_positions.erase(available_positions.begin());
    }

    p("step 1 complete");

    // Step 2: find another valid solution, if any
    // for each friend
    //  find all positions willing to accept this friend
    //  then figure out if any of the friends at those positions are OK to switch into this friend's position

    binary_indexed_tree<int> bit(N);
    event_index = 0;
    bool found_swap = false;
    vector<int> friend_at_position_2 = friend_at_position;
    for (int friend_index = 0; friend_index < N; ++friend_index) {
        while (event_index < events.size() && events[event_index].friend_index <= friend_index) {
            event e = events[event_index];
            int f = friend_at_position[e.position_index];
            if (e.is_start) {
                bit.add(f, 1);
            } else {
                bit.add(f, -1);
            }
            event_index++;
        }

        // ignore yourself
        assert(bit.sum(friend_index, friend_index + 1) == 1);
        bit.add(friend_index, -1);

        position p = positions[friend_to_position[friend_index]];

        if (bit.sum(p.l, p.r + 1) > 0) {
            found_swap = true;
            int desired_sum = bit.sum(p.l) + 1;
            int swap_friend = bit.lower_bound([desired_sum](int sum) {
                return sum >= desired_sum;
            });
            swap_friend--;

            assert(swap_friend >= p.l && swap_friend <= p.r);
            swap(friend_at_position_2[friend_index], friend_at_position_2[swap_friend]);
            break;
        }

        bit.add(friend_index, 1);
    }

    if (found_swap) {
        cout << "NO\n";
    } else {
        cout << "YES\n";
    }

    for (int i = 0; i < N; ++i) {
        cout << (1 + friend_at_position[i]);
        if (i == N - 1) cout << "\n";
        else cout << " ";
    }

    if (found_swap) {
        for (int i = 0; i < N; ++i) {
            cout << (1 + friend_at_position_2[i]);
            if (i == N - 1) cout << "\n";
            else cout << " ";
        }
    }

    return 0;
}
