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 + 5;
int n, pos[maxn];
struct Node {
  int l, r, id;
  bool operator<(const Node& b) const { return r < b.r; }
} p[maxn];
pair<int, int> pp[maxn], st[maxn << 2];
void build(int rt, int L, int R) {
  if (L == R) {
    st[rt] = pp[L];
    return;
  }
  int mid = (L + R) >> 1;
  build((rt << 1), L, mid);
  build((rt << 1 | 1), mid + 1, R);
  st[rt] = min(st[(rt << 1)], st[(rt << 1 | 1)]);
}
pair<int, int> query(int rt, int l, int r, int L, int R) {
  if (l <= L && R <= r) return st[rt];
  int mid = (L + R) >> 1;
  pair<int, int> ans = {n + 1, 0};
  if (l <= mid) ans = min(ans, query((rt << 1), l, r, L, mid));
  if (r > mid) ans = min(ans, query((rt << 1 | 1), l, r, mid + 1, R));
  return ans;
}
void print() {
  for (int i = 1; i <= n; ++i) printf("%d%c", pos[i], i == n ? '\n' : ' ');
}
int main() {
  set<int> s;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &p[i].l, &p[i].r);
    p[i].id = i;
    s.insert(i);
  }
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; ++i) {
    auto it = s.lower_bound(p[i].l);
    pos[p[i].id] = *it;
    pp[*it] = {p[i].l, p[i].id};
    s.erase(it);
  }
  build(1, 1, n);
  for (int i = 1; i <= n; ++i) {
    int Pi = pos[p[i].id], Ri = p[i].r;
    if (Pi + 1 > Ri) continue;
    pair<int, int> res = query(1, Pi + 1, Ri, 1, n);
    if (res.first > Pi) continue;
    puts("NO");
    print();
    swap(pos[res.second], pos[p[i].id]);
    print();
    return 0;
  }
  puts("YES");
  print();
  return 0;
}