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 target("avx2")
#pragma GCC optimize("O3")
using namespace std;
const int mod = (int)1e9 + 7;
const int N = (int)2e5 + 123;
const long long inf = (long long)1e18 + 1;
const double pi = acos(-1.0);
const double eps = 1e-7;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
int n, a[N], b[N], p[N], t[4 * N];
vector<int> add[N], del[N];
set<pair<int, int> > s;
void upd(int pos, int val, int v = 1, int tl = 1, int tr = n) {
  if (tl == tr) {
    if (val < 0)
      t[v] = mod;
    else
      t[v] = val;
    return;
  }
  int tm = tl + tr >> 1;
  if (pos <= tm)
    upd(pos, val, v + v, tl, tm);
  else
    upd(pos, val, v + v + 1, tm + 1, tr);
  t[v] = min(t[v + v], t[v + v + 1]);
}
int get(int l, int r, int v = 1, int tl = 1, int tr = n) {
  if (tl > r || tr < l) return mod;
  if (l <= tl && tr <= r) return t[v];
  int tm = tl + tr >> 1;
  return min(get(l, r, v + v, tl, tm), get(l, r, v + v + 1, tm + 1, tr));
}
inline void boost() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
inline void Solve() {
  cin >> n;
  set<int> s;
  for (int i = 1; i <= n; i++) s.insert(i);
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i], add[b[i]].push_back(i);
  for (int i = 1; i <= n; i++) {
    for (auto it : add[i]) {
      p[it] = *s.lower_bound(a[it]);
      s.erase(p[it]);
    }
  }
  for (int i = 1; i <= n; i++) add[i].clear();
  for (int i = 1; i < 4 * N; i++) t[i] = mod;
  for (int i = 1; i <= n; i++) {
    add[a[i]].push_back(i);
    del[b[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    for (auto it : add[i]) upd(p[it], a[it]);
    for (auto it : del[i]) {
      if (get(p[it] + 1, b[it]) <= p[it]) {
        int x = it, y = -1;
        for (int j = 1; j <= n; j++) {
          if (x == j) continue;
          if (p[x] < p[j] && p[j] <= b[it] && a[j] <= p[it]) {
            y = j;
            break;
          }
        }
        if (y == -1) cout << 1 / 0, exit(0);
        cout << "NO\n";
        for (int z = 1; z <= n; z++) cout << p[z] << ' ';
        cout << '\n';
        swap(p[x], p[y]);
        for (int z = 1; z <= n; z++) cout << p[z] << ' ';
        exit(0);
      }
    }
    for (auto it : del[i]) upd(p[it], -a[it]);
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << p[i] << ' ';
}
signed main() {
  int tt = 1;
  while (tt--) {
    Solve();
  }
  return 0;
}
