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(2)
using namespace std;
const int N = 2e5 + 5;
const int M = 3005;
const int inf = 0x3f3f3f3f;
const int mod = 300;
const double eps = 1e-9;
const long double pi = acos(-1.0L);
long long read() {
  long long x = 0, t = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') t = -1;
  while (isdigit(ch)) {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * t;
}
struct node {
  int x, y;
  node() {}
  node(int X, int Y) {
    x = X;
    y = Y;
  }
  friend bool operator<(node t1, node t2) { return t1.x > t2.x; }
};
int c[N << 2], L[N], R[N], id[N], pos[N];
vector<node> a[N];
priority_queue<node> q;
void build(int i, int l, int r) {
  if (l == r) {
    c[i] = L[id[l]];
    return;
  }
  int mid = l + r >> 1;
  build((i << 1), l, mid);
  build((i << 1 | 1), mid + 1, r);
  c[i] = min(c[(i << 1)], c[(i << 1 | 1)]);
}
int query(int i, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) return c[i];
  int mid = l + r >> 1;
  int t1 = inf, t2 = inf;
  if (mid >= ll) t1 = query((i << 1), l, mid, ll, rr);
  if (mid < rr) t2 = query((i << 1 | 1), mid + 1, r, ll, rr);
  return min(t1, t2);
}
int main() {
  int n = read();
  for (int i = 1; i <= n; i++) {
    L[i] = read();
    R[i] = read();
    a[L[i]].push_back(node(R[i], i));
  }
  for (int i = 1; i <= n; i++) {
    for (auto x : a[i]) q.push(x);
    id[i] = q.top().y;
    pos[id[i]] = i;
    q.pop();
  }
  build(1, 1, n);
  for (int i = 1; i <= n; i++) {
    int tmp = inf;
    if (i < R[id[i]]) tmp = query(1, 1, n, i + 1, R[id[i]]);
    if (tmp <= i) {
      int j;
      for (j = i + 1; j <= R[id[i]]; j++)
        if (L[id[j]] <= i) break;
      printf("NO\n");
      for (int j = 1; j <= n; j++) printf("%d%c", pos[j], j == n ? '\n' : ' ');
      swap(pos[id[i]], pos[id[j]]);
      for (int j = 1; j <= n; j++) printf("%d%c", pos[j], j == n ? '\n' : ' ');
      return 0;
    }
  }
  printf("YES\n");
  for (int j = 1; j <= n; j++) printf("%d%c", pos[j], j == n ? '\n' : ' ');
  return 0;
}
