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 int mod = 998244353;
const long double error = 2e-6;
const long double PI = acosl(-1);
mt19937 rng((unsigned)chrono::system_clock::now().time_since_epoch().count());
inline long long int MOD(long long int x, long long int m = mod) {
  long long int y = x % m;
  return (y >= 0) ? y : y + m;
}
const int inf = 1e9;
const long long int infl = 1061109567;
const int nmax = 2e5 + 10;
int L[nmax], R[nmax];
int indice[nmax], ans[nmax];
vector<int> start[nmax];
const int lgn = 32 - __builtin_clz(nmax);
int sparse[nmax][lgn];
void buildsparse(int n) {
  for (int i = 1; i <= n; i++) sparse[i][0] = indice[i];
  for (int k = 1, p = 1; k < lgn; k++, p <<= 1)
    for (int i = 1; i + p + p <= n + 1; i++)
      sparse[i][k] = ((L[sparse[i][k - 1]] < L[sparse[i + p][k - 1]])
                          ? (sparse[i][k - 1])
                          : (sparse[i + p][k - 1]));
}
int query(int l, int r) {
  int len = r - l + 1;
  int k = 32 - __builtin_clz(len) - 1;
  return ((L[sparse[l][k]] < L[sparse[r - (1 << k) + 1][k]])
              ? (sparse[l][k])
              : (sparse[r - (1 << k) + 1][k]));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> L[i] >> R[i];
    start[L[i]].push_back(i);
  }
  priority_queue<pair<int, int>> pq;
  int cur = 1;
  while (cur <= n) {
    for (int x : start[cur]) pq.push({-R[x], x});
    int x = pq.top().second;
    pq.pop();
    indice[cur] = x;
    cur++;
  }
  for (int i = 1; i <= n; i++) ans[indice[i]] = i;
  buildsparse(n);
  int s1 = 0, s2 = 0;
  for (int i = 1; i <= n; i++) {
    int x = indice[i];
    int r = R[x];
    if (i == r) continue;
    int y = query(i + 1, r);
    if (L[y] <= i) {
      s1 = x, s2 = y;
      break;
    }
  }
  if (s1)
    cout << "NO\n";
  else
    cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  if (s1 == 0) return 0;
  swap(ans[s1], ans[s2]);
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}