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("O3")
using namespace std;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
int N;
int A[200011];
int B[200011];
int ans[200011];
vector<int> H[200011];
pair<int, int> pa[200011];
void MAIN() {
  scanf("%d", &N);
  for (int i = 0, i_len = (N); i < i_len; ++i)
    scanf("%d%d", A + i, B + i), A[i]--;
  for (int i = 0, i_len = (N); i < i_len; ++i) H[A[i]].push_back(i);
  priority_queue<pair<int, int> > Q;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    for (__typeof((H[i]).begin()) e = (H[i]).begin(), e_end = (H[i]).end();
         e != e_end; ++e)
      Q.emplace(-B[*e], *e);
    assert(Q.size());
    assert(i < -Q.top().first);
    auto a = Q.top();
    Q.pop();
    ans[a.second] = i;
  }
  int x = -1, y = -1;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    for (__typeof((H[i]).begin()) e = (H[i]).begin(), e_end = (H[i]).end();
         e != e_end; ++e)
      Q.emplace(-B[*e], *e);
    auto a = Q.top();
    Q.pop();
    if (Q.size()) {
      auto b = Q.top();
      if (A[b.second] <= i && i < B[b.second] && A[a.second] <= ans[b.second] &&
          ans[b.second] < B[a.second]) {
        x = a.second;
        y = b.second;
        break;
      }
    }
  }
  for (int i = 0, i_len = (N); i < i_len; ++i) ans[i]++;
  if (x == -1) {
    puts("YES");
    rprintf("%d", ans, ans + N);
  } else {
    puts("NO");
    rprintf("%d", ans, ans + N);
    swap(ans[x], ans[y]);
    rprintf("%d", ans, ans + N);
  }
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}