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;
using ll = long long;
using ii = pair<int, int>;
const int N = 200005;
pair<ii, int> v[N];
int ans[N];
int rec[N];
int ans2[N];
struct SegTree {
  vector<ii> st;
  int n;
  SegTree(int sz) {
    st.resize(4 * (sz + 1), {0, 0});
    n = sz;
  }
  void upd(int p, int l, int r, int x, int val) {
    if (l == r && r == x) {
      st[p] = {val, x};
      return;
    }
    if (l > x || r < x) return;
    int mid = (l + r) / 2;
    upd(2 * p, l, mid, x, val);
    upd(2 * p + 1, mid + 1, r, x, val);
    st[p] = max(st[2 * p], st[2 * p + 1]);
  }
  ii qry(int p, int l, int r, int ql, int qr) {
    if (l >= ql && r <= qr) {
      return st[p];
    }
    if (l > qr || r < ql) return {0, 0};
    int mid = (l + r) / 2;
    return max(qry(2 * p, l, mid, ql, qr), qry(2 * p + 1, mid + 1, r, ql, qr));
  }
  void upd(int x, int val) { upd(1, 1, n, x, val); }
  ii qry(int l, int r) { return qry(1, 1, n, l, r); }
};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &v[i].first.first, &v[i].first.second);
    v[i].second = i + 1;
  }
  sort(v, v + n);
  int id = 0;
  set<ii> s;
  for (int i = 1; i <= n; i++) {
    while (id < n && v[id].first.first <= i) {
      s.insert({v[id].first.second, id});
      id++;
    }
    assert(s.size());
    ans[s.begin()->second] = i;
    rec[i] = s.begin()->second;
    s.erase(s.begin());
  }
  bool ok = 1;
  int swp1, swp2;
  SegTree st(n);
  for (int i = 1; i <= n; i++) {
    int l, r;
    tie(l, r) = v[rec[i]].first;
    ii x = st.qry(l, i);
    if (x.first >= i) {
      swp1 = x.second;
      swp2 = i;
      ok = 0;
      break;
    }
    st.upd(i, r);
  }
  printf("%s\n", ok ? "YES" : "NO");
  for (int i = 0; i < n; i++) {
    ans2[v[i].second] = ans[i];
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans2[i]);
  }
  printf("\n");
  if (!ok) {
    for (int i = 1; i <= n; i++) {
      if (ans2[i] == swp1) {
        printf("%d ", swp2);
      } else if (ans2[i] == swp2) {
        printf("%d ", swp1);
      } else {
        printf("%d ", ans2[i]);
      }
    }
    printf("\n");
  }
  return 0;
}
