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 INF = 0x3f3f3f3f;
const double pi = acos(-1), eps = 1e-8;
const int maxn = 1 << 17;
const int N = 1e6 + 7, M = 1 << 16, mod = 1e9 + 7;
int n, m;
struct node {
  int l, r;
  int id;
  bool operator<(const node &x) const {
    if (l == x.l) return r < x.r;
    return l < x.l;
  }
} a[N];
struct nd {
  int r, id;
  bool operator<(const nd &x) const { return r > x.r; }
};
int l[N], r[N];
int pos[N];
int ans[N];
vector<int> v[N], w[N];
int s[N], flag[N];
void update(int a, int b, int x, int k, int l, int r) {
  if (a == l && b == r) {
    s[x] = max(s[x], k);
    flag[x] = max(flag[x], k);
    return;
  }
  int mid = l + r >> 1, ls = x << 1, rs = x << 1 | 1;
  if (flag[x]) {
    update(l, mid, ls, flag[x], l, mid);
    update(mid + 1, r, rs, flag[x], mid + 1, r);
    flag[x] = 0;
  }
  if (b <= mid)
    update(a, b, ls, k, l, mid);
  else if (a > mid)
    update(a, b, rs, k, mid + 1, r);
  else {
    update(a, mid, ls, k, l, mid);
    update(mid + 1, b, rs, k, mid + 1, r);
  }
  s[x] = max(s[ls], s[rs]);
}
int query(int loc, int x, int l, int r) {
  if (l == r) return s[x];
  int mid = l + r >> 1, ls = x << 1, rs = x << 1 | 1;
  if (flag[x]) {
    update(l, mid, ls, flag[x], l, mid);
    update(mid + 1, r, rs, flag[x], mid + 1, r);
    flag[x] = 0;
  }
  if (loc <= mid)
    return query(loc, ls, l, mid);
  else
    return query(loc, rs, mid + 1, r);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].l, &a[i].r);
    a[i].id = i;
    l[i] = a[i].l, r[i] = a[i].r;
  }
  sort(a + 1, a + 1 + n);
  int now = 1;
  priority_queue<nd> q;
  for (int i = 1; i <= n; i++) {
    while (a[now].l <= i && now <= n) {
      q.push(nd{a[now].r, a[now].id});
      now++;
    }
    nd x = q.top();
    q.pop();
    ans[x.id] = i;
    pos[i] = x.id;
  }
  int flag = 0, f = 0;
  for (int i = 1; i <= n; i++) {
    int x = pos[i];
    int y = query(i, 1, 1, n);
    if (l[x] <= y) {
      flag = x, f = pos[y];
      break;
    }
    update(i, r[x], 1, i, 1, n);
  }
  if (flag == 0) {
    printf("YES\n");
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  } else {
    printf("NO\n");
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
    printf("\n");
    swap(ans[flag], ans[f]);
    for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  }
  return 0;
}