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;
clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
template <typename T>
void _F(const char *name, T arg1) {
  cerr << name << " = " << arg1 << '\n';
}
template <typename T, typename... Args>
void _F(const char *names, T arg1, Args... args) {
  const char *name = strchr(names, ',');
  cerr.write(names, name - names) << " = " << arg1 << '\n';
  _F(name + 2, args...);
}
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &q) {
  in >> q.first >> q.second;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> &q) {
  out << q.first << " " << q.second;
  return out;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first + p2.first, p1.second + p2.second};
}
template <typename T1, typename T2>
pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2) {
  return {p1.first - p2.first, p1.second - p2.second};
}
const long long N = 2e5 + 10;
long long l[N], r[N], ans[N], tmp[N], pos[N];
long long n;
vector<pair<long long, long long> > Q[N];
struct segm {
  long long seg[4 * N];
  segm() {
    for (long long i = 0; i < 4 * N; i++) {
      seg[i] = -1;
    }
  }
  void build(long long s, long long e, long long v) {
    if (s == e)
      seg[v] = ans[s];
    else {
      long long mid = (s + e) / 2;
      build(s, mid, 2 * v), build(mid + 1, e, 2 * v + 1);
      long long left = 2 * v, right = 2 * v + 1;
      if (r[seg[left]] < r[seg[right]]) swap(left, right);
      seg[v] = seg[left];
    }
  }
  long long query(long long s, long long e, long long v, long long ll,
                  long long rr) {
    if (ll > e || rr < s)
      return -1;
    else if (ll <= s && rr >= e)
      return seg[v];
    else {
      long long mid = (s + e) / 2;
      long long left = query(s, mid, 2 * v, ll, rr);
      long long right = query(mid + 1, e, 2 * v + 1, ll, rr);
      if (left == -1) return right;
      if (right == -1) return left;
      if (r[left] < r[right]) swap(left, right);
      return left;
    }
  }
} st;
void PrintAns() {
  for (long long i = 1; i <= n; i++) tmp[ans[i]] = i;
  for (long long i = 1; i <= n; i++) cout << tmp[i] << " ";
  cout << '\n';
}
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> l[i] >> r[i];
    Q[l[i]].push_back(make_pair(r[i], i));
  }
  for (long long i = 1; i <= n; i++) sort((Q[i]).begin(), (Q[i]).end());
  set<pair<long long, long long> > open;
  for (long long i = 1; i <= n; i++) {
    while ((long long)((Q[i]).size())) {
      open.insert(Q[i].back());
      Q[i].pop_back();
    }
    while ((long long)((open).size()) && (*begin(open)).first < i) {
      open.erase(begin(open));
    }
    ans[i] = (*begin(open)).second;
    pos[ans[i]] = i;
    open.erase(begin(open));
  }
  st.build(1, n, 1);
  for (long long i = 2; i <= n; i++) {
    long long j = st.query(1, n, 1, l[ans[i]], i - 1);
    if (j != -1 && r[j] >= i) {
      cout << "NO" << '\n';
      PrintAns();
      swap(ans[i], ans[pos[j]]);
      PrintAns();
      return;
    }
  }
  cout << "YES" << '\n';
  PrintAns();
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  start = clock();
  cout << fixed << setprecision(20);
  for (long long i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}