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;
const int N = 2e5 + 5;
struct node {
  int l, r;
  int id;
};
void ans_swap(vector<int> &vec, int a, int b) {
  int p1, p2;
  for (int i = 1; i < vec.size(); i++) {
    if (vec[i] == a) p1 = i;
    if (vec[i] == b) p2 = i;
  }
  swap(vec[p1], vec[p2]);
}
void out(vector<int> &vec) {
  for (int i = 1; i < vec.size(); i++) {
    cout << vec[i] << ' ';
  }
  cout << '\n';
}
int F_Min[N][20], F_Max[N][20];
int Min(int l, int r) {
  if (l > r) {
    return 1e9;
  }
  int k = (int)(log(double(r - l + 1)) / log((double)2));
  return min(F_Min[l][k], F_Min[r - (1 << k) + 1][k]);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<node> v(n + 1), v2(n + 1);
  vector<int> ans(n + 1);
  set<int> s;
  for (int i = 1; i <= n; i++) {
    s.insert(i);
    cin >> v[i].l >> v[i].r;
    v[i].id = i;
    v2[i] = v[i];
  }
  sort(v.begin(), v.end(), [](node &a, node &b) { return a.r < b.r; });
  for (int i = 1; i <= n; i++) {
    int p = v[i].id;
    int l = v[i].l;
    int val = *s.lower_bound(l);
    ans[p] = val;
    s.erase(val);
  }
  for (int i = 1; i <= n; i++) {
    v2[i].id = ans[i];
  }
  sort(v2.begin(), v2.end(), [](node &a, node &b) { return a.id < b.id; });
  for (int i = 1; i <= n; i++) {
    F_Min[i][0] = F_Max[i][0] = v2[i].l;
  }
  for (int i = 1; (1 << i) <= n; i++) {
    for (int j = 1; j + (1 << i) - 1 <= n; j++) {
      F_Max[j][i] = max(F_Max[j][i - 1], F_Max[j + (1 << (i - 1))][i - 1]);
      F_Min[j][i] = min(F_Min[j][i - 1], F_Min[j + (1 << (i - 1))][i - 1]);
    }
  }
  for (int i = 1; i <= n; i++) {
    int t_min = Min(i + 1, v2[i].r);
    if (t_min <= i) {
      cout << "NO" << endl;
      out(ans);
      for (int j = i + 1; j <= n; j++) {
        if (v2[j].l == t_min && i <= v2[j].r) {
          ans_swap(ans, i, j);
          break;
        }
      }
      out(ans);
      return 0;
    }
  }
  cout << "YES" << endl;
  out(ans);
}
