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;
long long gcd(long long a, long long b) {
  for (; b; a %= b, swap(a, b))
    ;
  return a;
}
int n;
struct pos {
  int l;
  int r;
  int idx;
  bool operator<(const pos p) const {
    if (r != p.r)
      return r < p.r;
    else if (l != p.l)
      return l < p.l;
    return idx < p.idx;
  }
};
bool comp(pos p1, pos p2) { return p1.l < p2.l; }
const int N = 200001;
pos p[N], tmp[N];
set<pos> st;
int ans1[N], ans2[N];
int ans_idx[N];
pair<int, int> segTree[N * 4];
void update(int ptr, int l, int r, int i, pair<int, int> val) {
  if (l > i || r < i) return;
  if (l == r) {
    segTree[ptr] = val;
    return;
  }
  update(ptr * 2, l, (l + r) / 2, i, val);
  update(ptr * 2 + 1, (l + r) / 2 + 1, r, i, val);
  segTree[ptr] = max(segTree[ptr * 2], segTree[ptr * 2 + 1]);
}
pair<int, int> getVal(int ptr, int l, int r, int i, int j) {
  if (l > j || r < i) return {0, 0};
  if (i <= l && r <= j) return segTree[ptr];
  return max(getVal(ptr * 2, l, (l + r) / 2, i, j),
             getVal(ptr * 2 + 1, (l + r) / 2 + 1, r, i, j));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i].l >> p[i].r;
    p[i].idx = i;
    tmp[i] = p[i];
  }
  sort(p, p + n, comp);
  int ptr = 0;
  bool isYes = true;
  for (int i = 0; i < n; i++) {
    while (ptr < n && p[ptr].l == i + 1) st.insert(p[ptr++]);
    pos cur = *st.begin();
    st.erase(st.begin());
    ans1[cur.idx] = i + 1;
    ans2[cur.idx] = i + 1;
    ans_idx[i + 1] = cur.idx;
  }
  for (int i = 1; i <= n; i++) {
    int idx = ans_idx[i];
    pair<int, int> v = {tmp[idx].r, idx};
    update(1, 1, n, i, v);
    if (i > 1 && isYes) {
      pair<int, int> res = getVal(1, 1, n, tmp[idx].l, i - 1);
      if (res.first >= i) {
        isYes = false;
        swap(ans2[res.second], ans2[idx]);
      }
    }
  }
  if (isYes) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << ans1[i] << ' ';
  } else {
    cout << "NO\n";
    for (int i = 0; i < n; i++) cout << ans1[i] << ' ';
    cout << "\n";
    for (int i = 0; i < n; i++) cout << ans2[i] << ' ';
  }
}