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 long long MAXN = 1e6 + 5;
int ans1, ans2;
int l[MAXN];
int r[MAXN];
int res[MAXN];
int pos[MAXN];
int n;
vector<int> v2;
priority_queue<pair<int, int>> q1;
vector<pair<pair<int, int>, int>> v1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> l[i] >> r[i];
    v1.push_back(make_pair(make_pair(l[i], r[i]), i));
  }
  sort(v1.begin(), v1.end());
  int ind = 0;
  for (int i = 1; i <= n; i++) {
    while (ind < n && v1[ind].first.first <= i) {
      q1.push(make_pair(-v1[ind].first.second, v1[ind].second));
      ind++;
    }
    res[i] = q1.top().second;
    q1.pop();
  }
  for (int i = 1; i <= n; i++) {
    while (v2.size() && r[res[v2.back()]] < i) {
      v2.pop_back();
    }
    int currl = l[res[i]];
    int currr = r[res[i]];
    if (v2.size() && currl <= v2.back()) {
      ans1 = i;
      ans2 = v2.back();
    }
    while (v2.size() && currr >= r[res[v2.back()]]) {
      v2.pop_back();
    }
    v2.push_back(i);
  }
  if (ans1) {
    cout << "NO" << endl;
    ;
    for (int i = 1; i <= n; i++) {
      pos[res[i]] = i;
    }
    for (int i = 1; i <= n; i++) {
      cout << pos[i] << " ";
    }
    cout << endl;
    for (int i = 1; i <= n; i++) {
      if (i == ans1) {
        pos[res[ans2]] = i;
      } else if (i == ans2) {
        pos[res[ans1]] = i;
      } else {
        pos[res[i]] = i;
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << pos[i] << " ";
    }
  } else {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      pos[res[i]] = i;
    }
    for (int i = 1; i <= n; i++) {
      cout << pos[i] << " ";
    }
    cout << endl;
  }
}