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("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC optimize(3, "Ofast", "inline")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const double esp = 1e-6, pi = acos(-1);
const int N = 1e6 + 10, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int val[N], p[N], n, L[N], R[N];
struct node {
  int l, r, id;
  bool operator<(const node &a) const {
    if (l != a.l) return l < a.l;
    return r < a.r;
  }
} e[N];
int sum[N * 4];
void up(int rt) { sum[rt] = sum[rt << 1] + sum[rt << 1 | 1]; }
void update(int rt, int l, int r, int pos, int k) {
  if (l == r) {
    sum[rt] += k;
    return;
  }
  int mid = l + r >> 1;
  if (pos <= mid)
    update(rt << 1, l, mid, pos, k);
  else
    update(rt << 1 | 1, mid + 1, r, pos, k);
  up(rt);
}
int ask(int rt, int l, int r, int ql, int qr) {
  if (l == r) {
    if (sum[rt]) return l;
    return 0;
  }
  int ans = 0, mid = l + r >> 1;
  if (ql <= mid && sum[rt << 1]) ans = ask(rt << 1, l, mid, ql, qr);
  if (qr > mid && sum[rt << 1 | 1] && !ans)
    ans = ask(rt << 1 | 1, mid + 1, r, ql, qr);
  return ans;
}
int work() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &L[i], &R[i]);
    e[i] = {L[i], R[i], i};
  }
  sort(e + 1, e + n + 1);
  set<pair<int, int> > s;
  for (int i = 1, j = 1; i <= n; i++) {
    while (j <= n && e[j].l == i) s.insert({e[j].r, e[j].id}), j++;
    p[i] = (*s.begin()).second;
    val[p[i]] = i;
    s.erase(s.begin());
  }
  for (int i = 1, j = 1; i <= n; i++) {
    int id = p[i];
    while (j <= n && e[j].l == i) update(1, 1, n, val[e[j].id], 1), j++;
    update(1, 1, n, val[id], -1);
    int ans = ask(1, 1, n, L[id], R[id]);
    if (ans) {
      puts("NO");
      for (int i = 1; i <= n; i++) cout << val[i] << " ";
      puts("");
      swap(val[id], val[p[ans]]);
      for (int i = 1; i <= n; i++) cout << val[i] << " ";
      puts("");
      return 0;
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++) cout << val[i] << " ";
  puts("");
  return 0;
}
int main() {
  work();
  return 0;
}