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 = 200010;
struct P {
  int l, r, id;
} p[MAXN];
struct cmp {
  bool operator()(P a, P b) { return a.r > b.r; }
};
int n, a[MAXN], b[MAXN], xl[MAXN], xr[MAXN], rev[MAXN];
bool cmp1(P a, P b) { return a.l < b.l; }
bool cmp2(P a, P b) { return a.r > b.r; }
priority_queue<P, vector<P>, cmp> q, q2;
multiset<int> ms;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &p[i].l, &p[i].r);
    p[i].id = i;
  }
  multiset<int>::iterator it;
  sort(p + 1, p + n + 1, cmp1);
  int cur = 1, flg = 0;
  for (int i = 1; i <= n; i++) {
    while (cur <= n && p[cur].l <= i) {
      q.push(p[cur]);
      cur++;
    }
    P tmp = q.top();
    q.pop();
    a[tmp.id] = b[tmp.id] = i, xl[tmp.id] = tmp.l, xr[tmp.id] = tmp.r,
    rev[i] = tmp.id;
    q2.push(tmp);
    while (!q2.empty() && q2.top().r < i) {
      P tmp2 = q2.top();
      q2.pop();
      it = ms.find(a[tmp2.id]);
      ms.erase(it);
    }
    if (!ms.empty() && !flg) {
      it = ms.end();
      it--;
      if (*it >= tmp.l) {
        flg = 1;
        swap(b[tmp.id], b[rev[*it]]);
      }
    }
    ms.insert(i);
  }
  if (flg) {
    printf("NO\n");
    for (int i = 1; i <= n; i++) {
      printf("%d ", a[i]);
    }
    printf("\n");
    for (int i = 1; i <= n; i++) {
      printf("%d ", b[i]);
    }
    printf("\n");
  } else {
    printf("YES\n");
    for (int i = 1; i <= n; i++) {
      printf("%d ", a[i]);
    }
    printf("\n");
  }
  return 0;
}