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>
using namespace std;
template <typename T>
inline bool ckmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool ckmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int N = 2e5 + 10;
int n;
int a[N], b[N], id[N], c[N], r[N];
int lab[N];
multiset<pair<int, int> > S;
int cmp(int first, int second) { return a[first] < a[second]; }
int ocmp(int first, int second) { return b[first] < b[second]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i], &b[i]);
    id[i] = lab[i] = i;
  }
  sort(id + 1, id + n + 1, cmp);
  sort(lab + 1, lab + n + 1, ocmp);
  int now = 0;
  for (int i = 1; i <= n; i++) {
    while (now + 1 <= n && a[id[now + 1]] <= i)
      now++, S.insert(make_pair(b[id[now]], id[now]));
    int u = S.begin()->second;
    c[u] = i, r[i] = u;
    S.erase(S.begin());
  }
  int n1 = 0, n2 = 0;
  for (int i = 1; i <= n; i++) {
    while (n1 + 1 <= n && a[id[n1 + 1]] <= i)
      n1++, S.insert(make_pair(c[id[n1]], id[n1]));
    S.erase(S.find(make_pair(c[r[i]], r[i])));
    multiset<pair<int, int> >::iterator it =
        S.lower_bound(make_pair(a[r[i]], 0));
    if (it != S.end() && it->first <= b[r[i]]) {
      int u = it->second;
      printf("NO\n");
      for (int i = 1; i <= n; i++) printf("%d%c", c[i], " \n"[i == n]);
      swap(c[r[i]], c[u]);
      for (int i = 1; i <= n; i++) printf("%d%c", c[i], " \n"[i == n]);
      return 0;
    }
    S.insert(make_pair(c[r[i]], r[i]));
    while (n2 + 1 <= n && b[lab[n2 + 1]] <= i)
      n2++, S.erase(S.find(make_pair(c[lab[n2]], lab[n2])));
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d%c", c[i], " \n"[i == n]);
  return 0;
}
