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>
namespace IO {
static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;
inline char myGetchar() {
  static char buf[IN_BUF], *ps = buf, *pt = buf;
  if (ps == pt) {
    ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
  }
  return ps == pt ? EOF : *ps++;
}
template <typename T>
inline bool read(T &x) {
  bool op = 0;
  char ch = IO::myGetchar();
  x = 0;
  for (; !isdigit(ch) && ch != EOF; ch = IO::myGetchar()) {
    op ^= (ch == '-');
  }
  if (ch == EOF) {
    return false;
  }
  for (; isdigit(ch); ch = IO::myGetchar()) {
    x = x * 10 + (ch ^ '0');
  }
  if (op) {
    x = -x;
  }
  return true;
}
inline int readStr(char *s) {
  int n = 0;
  char ch = IO::myGetchar();
  for (; isspace(ch) && ch != EOF; ch = IO::myGetchar())
    ;
  for (; !isspace(ch) && ch != EOF; ch = IO::myGetchar()) {
    s[n++] = ch;
  }
  s[n] = '\0';
  return n;
}
inline void myPutchar(char x) {
  static char pbuf[OUT_BUF], *pp = pbuf;
  struct _flusher {
    ~_flusher() { fwrite(pbuf, 1, pp - pbuf, stdout); }
  };
  static _flusher outputFlusher;
  if (pp == pbuf + OUT_BUF) {
    fwrite(pbuf, 1, OUT_BUF, stdout);
    pp = pbuf;
  }
  *pp++ = x;
}
template <typename T>
inline void print_(T x) {
  if (x == 0) {
    IO::myPutchar('0');
    return;
  }
  std::vector<int> num;
  if (x < 0) {
    IO::myPutchar('-');
    x = -x;
  }
  for (; x; x /= 10) {
    num.push_back(x % 10);
  }
  while (!num.empty()) {
    IO::myPutchar(num.back() ^ '0');
    num.pop_back();
  }
}
template <typename T>
inline void print(T x, char ch = '\n') {
  print_(x);
  IO::myPutchar(ch);
}
inline void printStr_(const char *s, int n = -1) {
  if (n == -1) {
    n = strlen(s);
  }
  for (int i = 0; i < n; ++i) {
    IO::myPutchar(s[i]);
  }
}
inline void printStr(const char *s, int n = -1, char ch = '\n') {
  printStr_(s, n);
  IO::myPutchar(ch);
}
}  // namespace IO
using namespace IO;
const int N = 200005, LG = 18;
int n, l[N], r[N];
int p[N], a[N];
int Log[N], mn[N][LG];
std::vector<std::pair<int, int>> vec[N];
int my_min(int x, int y) { return l[p[x]] < l[p[y]] ? x : y; }
void initST() {
  Log[1] = 0;
  for (int i = 2; i <= n; ++i) {
    Log[i] = Log[i >> 1] + 1;
  }
  for (int i = 1; i <= n; ++i) {
    mn[i][0] = i;
  }
  for (int j = 1; j < LG; ++j) {
    for (int i = 1; i + (1 << j) - 1 <= n; ++i) {
      mn[i][j] = my_min(mn[i][j - 1], mn[i + (1 << (j - 1))][j - 1]);
    }
  }
}
int query(int l, int r) {
  int t = Log[r - l + 1];
  return my_min(mn[l][t], mn[r - (1 << t) + 1][t]);
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) {
    read(l[i]), read(r[i]);
    vec[r[i]].push_back({l[i], i});
  }
  std::priority_queue<std::pair<int, int>> Q;
  for (int i = n; i; --i) {
    for (auto v : vec[i]) {
      Q.push(v);
    }
    p[i] = Q.top().second;
    Q.pop();
    a[p[i]] = i;
  }
  initST();
  int x = 0, y = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == r[p[i]]) {
      continue;
    }
    int j = query(i + 1, r[p[i]]);
    if (l[p[j]] <= i) {
      x = i, y = j;
      break;
    }
  }
  if (!x) {
    printStr("YES");
    for (int i = 1; i <= n; ++i) {
      print(a[i], ' ');
    }
    IO::myPutchar('\n');
  } else {
    printStr("NO");
    for (int i = 1; i <= n; ++i) {
      print(a[i], ' ');
    }
    IO::myPutchar('\n');
    std::swap(a[p[x]], a[p[y]]);
    for (int i = 1; i <= n; ++i) {
      print(a[i], ' ');
    }
    IO::myPutchar('\n');
  }
}