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

// Author: Sanskar Mani
// date: 2021-01-15 22:05:12
    
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
using namespace std;
#if DEBUG && !ONLINE_JUDGE
#include "debug.cpp"
#else 
#define debug(args...) 
#define test
#define print(a,n,k)
#endif
const int mod = 1000000007;
// const int mod = 998244353;
// #define int long long
#define TIME (chrono::steady_clock::now().time_since_epoch().count())
#define ull unsigned long long
#define ok order_of_key
#define fo find_by_order
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repp(i,n) for(int i=(0);i<(n);i++)
#define repr(i,n) for(int i=(n);i>=0;i--)
#define newl cout<<'\n'
#define inf 1000000000
#define repaa(i,a) for(auto j=a.rbegin(),auto i = *j;j!=a.rend();++j,i=*j)
#define pb push_back 
#define tc int tt;cin>>tt;while(tt--)
#define mem(v,i) memset(v,i,sizeof(v))
#define all(x) x.begin(), x.end()
#define inf1 1e18
#define repa(i,a) for (auto i : a)
#define X first
#define Y second
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define in(a,n) repp(jjj,n)cin>>a[jjj];
#define intree(a,m) repp(i,m){int tmp1,tmp2;cin>>tmp1>>tmp2;tmp1--,tmp2--;a[tmp1].eb(tmp2);a[tmp2].eb(tmp1);}
#define ins insert
#define er erase
#define sz(a) (int)(a.size())
#define mt make_tuple
#define eb emplace_back
#define bpl(i) __builtin_popcountll(i)
#define bp(i) __builtin_popcount(i)
#define precision(x) cout << fixed << setprecision(x);
#define si set<int>
#define usi unordered_set<int>
#define sl set < ll >
#define usl unordered_set < ll >
#define sip set < ip >
#define sil set < il > 
#define mi map<int , int >
#define umi unordered_map<int , int >
#define ml map < ll , ll>
#define uml unordered_map < ll , ll>
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define srt(v) sort(all(v))
#define rsrt(v) sort(v.rbegin(), v.rend())
#define ld long double
#define vi vector<int> 
#define vl vector<ll>
#define vii vector < vi >
#define vip vector<pair<int,int>>
#define vil vector<pair<ll,ll>>
#define vll vector < vl >
#define ip pair<int, int>
#define il pair<ll, ll>
const int dx[4]={1,0,0,-1}, dy[4]={0,1,-1,0};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const char nl = '\n',sp = ' ';
#ifdef Fading
#define gc getchar
#endif
#ifndef Fading
inline char gc(){static char now[1<<16],*S,*T;if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}return *S++;}
#endif
ll R(ll B) {static mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());return (unsigned long long)rng() % B;}
inline ll read(){register ll x=0,f=1;char ch=gc();while (!isdigit(ch)){if(ch=='-')f=-1;ch=gc();}while (isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0';ch=gc();}return (f==1)?x:-x;}
ull mix(ull o){o+=0x9e3779b97f4a7c15;o=(o^(o>>30))*0xbf58476d1ce4e5b9;o=(o^(o>>27))*0x94d049bb133111eb;return o^(o>>31);}
template<typename T>T Min(T v) {return v;}template<typename T, typename... Args>T Min(T first, Args... args) {return min(first , Min(args...));}
template<typename T>T Max(T v) {return v;}template<typename T, typename... Args> T Max(T first, Args... args) {return max(first , Max(args...));}
ll mult(ll v) {return v%mod;}template<typename... Args>ll mult(ll first, Args... args) {return mult((first%mod * mult(args...))%mod);}
template<class T , class U> inline bool remax(T &a, U b) {return a<b?a=b,1:0;}template<class T , class U> inline bool remin(T &a, U b) { return a > b ? a = b, 1 : 0; }
template<class A, class B> void add(A &a, B b){a += b;if(a >= mod) a -= mod;if(a < 0) a += mod;}template<class A, class B> ll addr(A a, B b){a += b;if(a >= mod) a -= mod;if(a < 0) a += mod;return a;}
template<class T1,class T2>T2 min(T1 a,T2 b){return min((T2)a,b);}template<class T1,class T2>T2 max(T1 a,T2 b){return max((T2)a,b);}
void pnt(char a){if(a == nl || a == sp) cout << a;else cout << a << sp;}void pnt(string &a,int b = 0){cout << a << nl;}
template<class A> void pnt(A &a,int b=0) {cout << A(a + b) << sp;}template<class A ,class B> void pnt(pair<A,B>&a,int b=0){cout << A(a.X+b) << ' ' << B(a.Y+b) << nl;}
template<class A> void pnt(vector<A>&a,int b=0) {repa(i,a) pnt(i,b);}template<class A> void pnt(set<A>&a,int b=0) {repa(i,a) pnt(i,b);}
template<class A> void pnt(unordered_set<A>&a,int b=0) {repa(i,a) pnt(i,b) ;} template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.X>>v.Y;}
template<class T>struct isChar{bool ch(T a){return false;}};template<>struct isChar<char>{int ch(char s){return s == '`';}};
template<typename T>void W(T v){pnt(v);}template<typename T,typename A>void W(T f,A s) {if(isChar<A>().ch(s)) pnt(f,1);else pnt(f) ,W(s);}
template<typename T,typename A,typename... Args>void W(T f,A s,Args... args) {if(isChar<A>().ch(s)) pnt(f,1), W(args...);else pnt(f),W(s,args...);}
template <class T1>void kill(T1 ans){pnt(ans);exit(0);}ll nc2(ll a){return a * (a - 1) / 2;}
int mylog(ll x , ll y = 2){if(x == 0) return -1;return mylog(x/y,y) + 1;}ll setbit(ll n, ll kk){return 1LL*(n|(1LL<<kk));}
ll unsetbit(ll n, ll kk){return 1LL*(n&~(1LL<<kk));} ll invertbit(ll n, ll kk){return 1LL*(n^(1LL<<kk));}bool kthbit(ll n, ll kk){return n&(1LL<<kk);}
ll mceil(ll a, ll b){return a/b + (ll)(a%b > 0);} ll poww(ll a, ll b,ll m = mod){ll val = 1;a %= m;while (b > 0){if (b & 1) val = (a * val) % m;a = (a * a) % m;b >>= 1;}return val;}
ll inv(ll a,ll m=mod){return poww(a , m - 2);}ll gcdll(ll x, ll y){return y == 0 ? x : gcdll(y, x % y);}
    
//-------------------------------------------------LEZENDARY------------------------------------------------------------//
//------------------------------------------------------SANDWICH-------------------------------------------------------//
    
const int N = 2e5 + 5;
vii ans;
vi ad[N], rm[N], temp;
set < ip > seg; // r, i
int n;
ip a[N];
bool only[N];

int solve(int pos = 0){
    if(pos == n){
        ans.eb(temp);
        debug(vi(only,only + n));
        return 1;
    }
    vi del;
    repa(i,ad[pos]) seg.emplace(a[i].Y, i);
    repa(i,rm[pos]) {
        if(seg.count({a[i].Y, i})) seg.er({a[i].Y, i}), del.eb(i);
    }
    if(seg.empty()) {
        repa(i,del) seg.emplace(a[i].Y, i);
        repa(i,ad[pos]) seg.er({a[i].Y, i});
        return 0;
    }
    auto st = seg.begin();
    if(sz(seg) == 1) {
        debug(pos, st -> X);
        only[st -> Y] = 1;
    }
    auto nxt = next(st);
    ip nxxt = sz(seg) == 1 ? make_pair(-1,-1) : *nxt;
    temp[st -> Y] = pos + 1;
    ip sta = *st;
    seg.er(st);
    int is = solve(pos + 1);
    seg.ins(sta);
    debug(sta.X, nxxt.X);
    if(nxxt.X != -1 && ans.size() < 2 && is && (sta.X == nxxt.X || !only[nxxt.Y])){
        seg.er(nxxt);
        temp[nxxt.Y] = pos + 1;
        solve(pos + 1);
        seg.ins(nxxt);
    }
    repa(i,del) seg.emplace(a[i].Y, i);
    repa(i,ad[pos]) seg.er({a[i].Y, i});
    return is;
}

signed main()
{
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin >> n;
    in(a,n)
    temp.assign(n,0);
    repp(i,n){
        a[i].X --, a[i].Y --;
        ad[a[i].X].eb(i);
        rm[a[i].Y + 1].eb(i);
    }
    solve();
    W(sz(ans) == 2 ? "NO" : "YES", nl, ans[0], nl);
    if(sz(ans) == 2) W(ans[1]);
}
