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>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
using namespace std;
const int MAX_N = 2e5 + 5;
const int inf = 1e9;
struct node {
  int l, r, mn, pos;
} tr[MAX_N << 2];
void pushup(int k) {
  if (tr[k << 1].mn < tr[k << 1 | 1].mn)
    tr[k].mn = tr[k << 1].mn, tr[k].pos = tr[k << 1].pos;
  else
    tr[k].mn = tr[k << 1 | 1].mn, tr[k].pos = tr[k << 1 | 1].pos;
}
void build(int k, int l, int r) {
  tr[k].l = l, tr[k].r = r, tr[k].mn = inf, tr[k].pos = -1;
  if (l == r) {
    tr[k].pos = l;
    return;
  }
  int mid = (l + r) >> 1;
  build(k << 1, l, mid), build(k << 1 | 1, mid + 1, r);
}
void update(int k, int l, int r, int pos, int val) {
  if (l == r) {
    tr[k].mn = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(k << 1, l, mid, pos, val);
  else
    update(k << 1 | 1, mid + 1, r, pos, val);
  pushup(k);
}
pair<int, int> query(int k, int l, int r, int L, int R) {
  if (l == L && r == R) return pair<int, int>(tr[k].pos, tr[k].mn);
  int mid = (l + r) >> 1;
  if (L > mid)
    return query(k << 1 | 1, mid + 1, r, L, R);
  else if (R <= mid)
    return query(k << 1, l, mid, L, R);
  else {
    pair<int, int> t1 = query(k << 1, l, mid, L, mid),
                   t2 = query(k << 1 | 1, mid + 1, r, mid + 1, R);
    return (t1.second < t2.second) ? t1 : t2;
  }
}
struct node2 {
  int l, r, id, pos;
} p[MAX_N];
bool cmp(node2 a, node2 b) {
  if (a.r != b.r)
    return a.r < b.r;
  else
    return a.l < b.l;
}
set<int> s;
int id_pos[MAX_N], pos_id[MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  for (register int i = 1; i <= n; ++i)
    scanf("%d", &p[i].l), scanf("%d", &p[i].r), p[i].id = i, s.insert(i);
  sort(p + 1, p + 1 + n, cmp);
  build(1, 1, n);
  for (register int i = 1; i <= n; ++i) {
    auto it = s.lower_bound(p[i].l);
    id_pos[p[i].id] = *it, pos_id[*it] = p[i].id, p[i].pos = *it;
    update(1, 1, n, *it, p[i].l);
    s.erase(*it);
  }
  for (register int i = 1; i <= n; ++i) {
    int tmp = p[i].pos;
    if (tmp + 1 > n || tmp + 1 > p[i].r) continue;
    pair<int, int> tn = query(1, 1, n, tmp + 1, p[i].r);
    if (tn.second <= tmp) {
      puts("NO");
      for (register int j = 1; j <= n; ++j)
        printf("%d%c", id_pos[j], j == n ? '\n' : ' ');
      swap(id_pos[p[i].id], id_pos[pos_id[tn.first]]);
      for (register int j = 1; j <= n; ++j)
        printf("%d%c", id_pos[j], j == n ? '\n' : ' ');
      return 0;
    }
  }
  puts("YES");
  for (register int i = 1; i <= n; ++i)
    printf("%d%c", id_pos[i], i == n ? '\n' : ' ');
  return 0;
}