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 
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * f;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  putchar('\n');
}
inline void wri(long long x) {
  write(x);
  putchar(' ');
}
const int maxn = 2e5 + 233;
struct P {
  int l, r, id;
} p[maxn];
struct cmp {
  bool operator()(P a, P b) { return a.r > b.r; }
};
bool cmp2(P a, P b) { return a.r > b.r; }
bool cmp1(P a, P b) { return a.l < b.l; }
priority_queue<P, vector<P>, cmp> q, q2;
multiset<int> ms;
int n, a[maxn], b[maxn], rev[maxn];
int main() {
  n = read();
  for (int i = (1); i <= int(n); ++i) {
    p[i].l = read(), p[i].r = read();
    p[i].id = i;
  }
  sort(p + 1, p + 1 + n, cmp1);
  int cur = 1, flg = 0;
  for (int i = (1); i <= int(n); ++i) {
    for (; cur <= n && p[cur].l <= i; cur++) q.push(p[cur]);
    P tmp = q.top();
    q.pop();
    a[tmp.id] = b[tmp.id] = i;
    rev[i] = tmp.id;
    q2.push(tmp);
    while (!q2.empty() && q2.top().r < i) {
      P tmp2 = q2.top();
      q2.pop();
      auto it = ms.find(a[tmp2.id]);
      ms.erase(it);
    }
    if (!ms.empty() && !flg) {
      auto it = ms.end();
      it--;
      if (*it >= tmp.l) {
        flg = 1;
        swap(b[tmp.id], b[rev[*it]]);
      }
    }
    ms.insert(i);
  }
  if (flg) {
    puts("NO");
    for (int i = (1); i <= int(n); ++i) wri(a[i]);
    puts("");
    for (int i = (1); i <= int(n); ++i) wri(b[i]);
    puts("");
  } else {
    puts("YES");
    for (int i = (1); i <= int(n); ++i) wri(a[i]);
    puts("");
  }
  return 0;
}
