Problem: 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 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
constexpr int MX = 2e5 + 5;
template <typename T>
struct seg_tree {
  T seg[4 * MX], tmp[4 * MX];
  inline T pull(const T& a, const T& b) { return min(a, b); }
  void update(int x, T v, int l = 0, int r = MX - 1, int n = 1) {
    if (l == r) {
      seg[n] = v;
      return;
    }
    int m = l + r >> 1;
    x <= m ? update(x, v, l, m, n << 1) : update(x, v, m + 1, r, n << 1 | 1);
    seg[n] = pull(seg[n << 1], seg[n << 1 | 1]);
  }
  T query(int a, int b, int l = 0, int r = MX - 1, int n = 1) {
    if (a > b || l > b || r < a) return ii(1e9, 0);
    if (l >= a && r <= b) return seg[n];
    int m = l + r >> 1;
    return pull(query(a, b, l, m, n << 1), query(a, b, m + 1, r, n << 1 | 1));
  }
};
vector<ii> v[MX];
int a[MX], b[MX], P[MX], ans[MX];
seg_tree<ii> seg;
int main() {
  if (fopen("in", "r")) freopen("in", "r", stdin), freopen("out", "w", stdout);
  cin.tie(0)->sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
    --a[i], --b[i];
    v[a[i]].emplace_back(b[i], i);
  }
  set<ii> S;
  for (int i = 0; i < n; ++i) {
    S.insert(begin(v[i]), end(v[i]));
    ans[begin(S)->second] = i, P[i] = begin(S)->second;
    S.erase(begin(S));
  }
  for (int i = 0; i < n; ++i) seg.update(i, ii(a[P[i]], i));
  for (int i = 0; i < n; ++i) {
    ii j = seg.query(i + 1, b[P[i]]);
    if (j.first < 1e9 && a[P[j.second]] <= i) {
      cout << "NO\n";
      for (int _ : {0, 1}) {
        for (int k = 0; k < n; ++k) cout << ans[k] + 1 << ' ';
        cout << '\n';
        swap(ans[P[i]], ans[P[j.second]]);
      }
      return 0;
    }
  }
  cout << "YES\n";
  for (int k = 0; k < n; ++k) cout << ans[k] + 1 << ' ';
  cout << '\n';
}