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

Solution:
#include <bits/stdc++.h>
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int MAXN = 2e5 + 7;
const int INF = 0x3f3f3f3f;
int n, dz[MAXN];
vector<pair<int, pair<int, int>>> vec[MAXN];
int rmax[MAXN];
template <typename T>
struct SegmentTree {
  T maxx[MAXN << 2], lazy[MAXN << 2];
  int l[MAXN << 2], r[MAXN << 2];
  void build(int L, int R, int rt) {
    l[rt] = L;
    r[rt] = R;
    lazy[rt] = 0;
    if (L + 1 == R) return;
    int mid = (L + R) >> 1;
    build(L, mid, rt << 1);
    build(mid, R, rt << 1 | 1);
  }
  void pushdown(int rt) {
    if (!lazy[rt]) return;
    lazy[rt << 1] += lazy[rt];
    lazy[rt << 1 | 1] += lazy[rt];
    maxx[rt << 1] += lazy[rt];
    maxx[rt << 1 | 1] += lazy[rt];
    lazy[rt] = 0;
  }
  void update(int L, int R, int rt, T x) {
    if (L >= r[rt] || l[rt] >= R) return;
    if (L <= l[rt] && r[rt] <= R) {
      lazy[rt] += x;
      maxx[rt] += x;
      return;
    }
    pushdown(rt);
    update(L, R, rt << 1, x);
    update(L, R, rt << 1 | 1, x);
    maxx[rt] = max(maxx[rt << 1], maxx[rt << 1 | 1]);
  }
  T query(int L, int R, int rt) {
    if (L >= r[rt] || l[rt] >= R) return -INF;
    if (L <= l[rt] && r[rt] <= R) return maxx[rt];
    pushdown(rt);
    return max(query(L, R, rt << 1), query(L, R, rt << 1 | 1));
  }
};
SegmentTree<int> ST;
int main() {
  ____();
  cin >> n;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    rmax[i] = r;
    vec[l].push_back(make_pair(r, make_pair(l, i)));
  }
  priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>,
                 greater<pair<int, pair<int, int>>>>
      que;
  ST.build(0, n, 1);
  bool unq = true;
  vector<int> ret1, ret2;
  for (int i = 0; i < n; i++) {
    for (auto seg : vec[i]) que.push(seg);
    auto p = que.top();
    que.pop();
    ret1.push_back(p.second.second);
    if (!unq) {
      ret2.push_back(p.second.second);
      continue;
    }
    ST.update(i, i + 1, 1, p.first);
    if (!i) continue;
    int maxx = ST.query(p.second.first, i, 1);
    if (maxx < i) continue;
    unq = false;
    int pos = 0;
    for (int j = p.second.first; j < i; j++) {
      if (rmax[ret1[j]] >= i) {
        pos = j;
        break;
      }
    }
    copy(ret1.begin(), ret1.end(), back_inserter(ret2));
    swap(ret2[pos], ret2[i]);
  }
  if (unq) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) dz[ret1[i]] = i + 1;
    for (int i = 0; i < n; i++) cout << dz[i] << ' ';
    cout << endl;
  } else {
    cout << "NO" << endl;
    for (int i = 0; i < n; i++) dz[ret1[i]] = i + 1;
    for (int i = 0; i < n; i++) cout << dz[i] << ' ';
    cout << endl;
    for (int i = 0; i < n; i++) dz[ret2[i]] = i + 1;
    for (int i = 0; i < n; i++) cout << dz[i] << ' ';
    cout << endl;
  }
  return 0;
}