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;
const int MAXN = 2e5;
const int TSIZE = 1 << 19;
int T[TSIZE];
int tget(int x, int l, int r, int L, int R) {
  int m = min(r, R);
  int M = max(l, L);
  if (M <= m) {
    if (M == L && m == R) {
      return T[x];
    }
    int mid = (L + R + 1) / 2;
    return max(tget(2 * x + 1, l, r, L, mid - 1),
               tget(2 * x + 2, l, r, mid, R));
  }
  return 0;
}
int tget(int l, int r) { return tget(0, l, r, 0, TSIZE / 2 - 1); }
void tset(int x, int v, int p, int L, int R) {
  if (L == R) {
    T[x] = v;
    return;
  }
  int mid = (L + R + 1) / 2;
  if (p < mid)
    tset(2 * x + 1, v, p, L, mid - 1);
  else
    tset(2 * x + 2, v, p, mid, R);
  T[x] = max(T[2 * x + 1], T[2 * x + 2]);
}
void tset(int p, int v) { tset(0, v, p, 0, TSIZE / 2 - 1); }
int A[MAXN][2];
int B[MAXN];
int BI[MAXN];
int idx[MAXN];
struct ev {
  int x, t;
  bool operator<(const ev &p) const {
    if (x != p.x) return x < p.x;
    return t < p.t;
  }
};
ev E[MAXN * 2];
bool cmp(int a, int b) {
  if (A[a][1] != A[b][1]) return A[a][1] < A[b][1];
  return A[a][0] < A[b][0];
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d%d", &A[i][0], &A[i][1]);
  for (int i = 0; i < n; ++i) idx[i] = i;
  sort(idx, idx + n, cmp);
  set<int> have;
  for (int i = 1; i <= n; ++i) have.insert(i);
  int vi = -1, vj = -1;
  for (int i = 0; i < n; ++i) {
    int x = idx[i];
    set<int>::iterator f = have.lower_bound(A[x][0]);
    int v = *f;
    have.erase(f);
    B[x] = v;
    if (vi == -1) {
      int m = tget(A[x][0], v);
      if (m >= v) {
        vi = v;
        for (int i = A[x][0]; i <= v; ++i) {
          if (tget(i, i) >= v) {
            vj = i;
            break;
          }
        }
      }
    }
    tset(v, A[x][1]);
  }
  for (int i = 0; i < n; ++i) {
    BI[B[i] - 1] = i;
  }
  for (int i = 0; i < n; ++i) {
    E[2 * i].t = (i + 1);
    E[2 * i].x = A[i][0];
    E[2 * i + 1].t = -(i + 1);
    E[2 * i + 1].x = A[i][1] + 1;
  }
  sort(E, E + 2 * n);
  printf((vi == -1 ? "YES\n" : "NO\n"));
  for (int i = 0; i < n; ++i) printf("%d ", B[i]);
  printf("\n");
  if (vi != -1) {
    int i = BI[vi - 1];
    int j = BI[vj - 1];
    swap(B[i], B[j]);
    for (int i = 0; i < n; ++i) printf("%d ", B[i]);
    printf("\n");
  }
}
int main() {
  solve();
  return 0;
}