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 inf = 1 << 30;
struct segment_tree {
  int n;
  vector<pair<int, int>> a;
  segment_tree(int n) : n(n), a(2 * n, make_pair(inf, 0)) {}
  void update(int p, pair<int, int> v) {
    for (a[p += n] = v; p /= 2;) a[p] = min(a[2 * p], a[2 * p + 1]);
  }
  pair<int, int> query(int l, int r) {
    pair<int, int> g = {inf, 0};
    for (l += n, r += n; l < r; l /= 2, r /= 2) {
      if (l & 1) g = min(g, a[l++]);
      if (r & 1) g = min(g, a[--r]);
    }
    return g;
  }
};
struct info {
  int a, b, id;
};
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<info> a(n);
  for (auto &i : a) cin >> i.a >> i.b, --i.a, --i.b, i.id = &i - &a[0];
  stable_sort(a.begin(), a.end(),
              [](const info &x, const info &y) { return x.b < y.b; });
  segment_tree st(n);
  for (int i = 0; i < n; ++i) st.update(i, {0, i});
  vector<int> ans(n), id(n);
  for (auto &i : a) {
    int p = st.query(i.a, i.b + 1).second;
    ans[i.id] = p;
    id[p] = &i - &a[0];
    st.update(p, {inf, p});
  }
  for (int i = 0; i < n; ++i) st.update(ans[i], {a[id[ans[i]]].a, i});
  vector<int> ans2 = ans;
  for (int i = 0; i < n; ++i) {
    int x = ans2[i];
    if (x < a[id[x]].b) {
      auto q = st.query(x + 1, a[id[x]].b + 1);
      if (q.first <= x) {
        swap(ans2[i], ans2[q.second]);
        break;
      }
    }
  }
  if (ans == ans2) {
    cout << "YES\n";
    for (auto &i : ans) cout << i + 1 << " \n"[i == ans.back()];
  } else {
    cout << "NO\n";
    for (auto &i : ans) cout << i + 1 << " \n"[i == ans.back()];
    for (auto &i : ans2) cout << i + 1 << " \n"[i == ans2.back()];
  }
  return 0;
}
