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("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
const long long MOD2 = (long long)998244353 * (long long)998244353;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 998244353) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int a[200135], b[200135], ans[200135], w[200135];
vector<int> pos[200135];
void ppt() {
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d ", ans[i]);
  puts("");
}
const int MN = (1 << 19) + 5;
struct mb {
  int M, T[MN];
  void init(int sz) {
    for (M = 1; sz + 2 > M; M <<= 1)
      ;
  }
  void init(int sz, int val) {
    for (M = 1; sz + 2 > M; M <<= 1)
      ;
    for (int(i) = 0; (i) < (int)(MN); (i)++) T[i] = val;
  }
  void clear() { memset(T, 0, sizeof T); }
  void upt(int l, int r, int val) {
    for (l = l + M - 1, r = r + M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
      if (~l & 1) T[l ^ 1] = max(val, T[l ^ 1]);
      if (r & 1) T[r ^ 1] = max(val, T[r ^ 1]);
    }
  }
  int qy(int l) {
    int ans = 0;
    l += M;
    while (l >= 1) {
      ans = max(ans, T[l]);
      l >>= 1;
    }
    return ans;
  }
} T;
void fmain(int tid) {
  scanf("%d", &n);
  for (int(i) = 1; (i) <= (int)(n); (i)++) scanf("%d%d", a + i, b + i);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    pos[a[i]].push_back(i);
  }
  priority_queue<pair<int, int>, std::vector<pair<int, int>>,
                 std::greater<pair<int, int>>>
      q;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    for (int z : pos[i]) {
      q.push({b[z], z});
    }
    assert(!q.empty());
    auto pr = q.top();
    q.pop();
    ans[pr.second] = i;
    w[i] = pr.second;
  }
  T.init(n, 0);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    int z = T.qy(i);
    if (z >= a[w[i]]) {
      puts("NO");
      ppt();
      swap(ans[w[i]], ans[w[z]]);
      ppt();
      return;
    }
    T.upt(i, b[w[i]], i);
  }
  puts("YES");
  ppt();
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}