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;
template <class T>
using vec = std::vector<T>;
bool __hack = std::ios::sync_with_stdio(false);
auto __hack1 = cin.tie(nullptr);
namespace template_util {
constexpr int bytecount(uint64_t x) { return x ? 1 + bytecount(x >> 8) : 0; }
template <int N>
struct bytetype {};
template <uint64_t N>
struct minimal_uint : bytetype<bytecount(N)> {};
}  // namespace template_util
template <class T>
T next(istream& in) {
  T ret;
  in >> ret;
  return ret;
}
template <class T>
void outVec(ostream& out, const vector<T>& v) {
  if (v.empty()) {
    out << "\n";
    return;
  }
  out << v[0];
  for (size_t i = 1; i < v.size(); ++i) {
    out << ' ' << v[i];
  }
  out << "\n";
}
const int INF = numeric_limits<int>::max() / 2;
template <class T>
vec<T> incOne(const vec<T>& v) {
  vec<T> res(v.begin(), v.end());
  for (int i = 0; i < (res.size()); ++i) {
    ++res[i];
  }
  return res;
}
struct SegmentTree {
  vec<pair<int, int>> tree;
  int n;
  SegmentTree(int n, const vec<int>& values) : n(n) {
    tree = vec<pair<int, int>>(4 * n);
    build(1, 0, n, values);
  }
  void build(int v, int le, int ri, const vec<int>& values) {
    if (le + 1 == ri) {
      tree[v] = {values[le], le};
      return;
    }
    int mid = (le + ri) / 2;
    build(2 * v, le, mid, values);
    build(2 * v + 1, mid, ri, values);
    tree[v] = min(tree[2 * v], tree[2 * v + 1]);
  }
  pair<int, int> get(int le, int ri) { return internalGet(1, le, ri, 0, n); }
  pair<int, int> internalGet(int v, int l, int r, int ll, int rr) {
    if (l >= rr || ll >= r) return {INF, INF};
    if (l <= ll && rr <= r) {
      return tree[v];
    }
    int m = (ll + rr) / 2;
    auto res = internalGet(2 * v, l, r, ll, m);
    res = min(res, internalGet(2 * v + 1, l, r, m, rr));
    return res;
  }
};
void solve(istream& in, ostream& out) {
  auto n = next<int>(in);
  vec<int> le(n), ri(n), idx(n);
  for (int i = 0; i < (n); ++i) {
    le[i] = next<int>(in) - 1;
    ri[i] = next<int>(in) - 1;
    idx[i] = i;
  }
  sort(idx.begin(), idx.end(), [&](int a, int b) -> bool {
    return le[a] < le[b] || (le[a] == le[b] && ri[a] < ri[b]);
  });
  set<pair<int, int>> Q;
  vec<int> assignments(n), lefts(n), revAssign(n);
  int ptr = 0;
  for (int i = 0; i < (n); ++i) {
    while (ptr < n && le[idx[ptr]] <= i) {
      Q.insert({ri[idx[ptr]], idx[ptr]});
      ++ptr;
    }
    auto p = *Q.begin();
    Q.erase(Q.begin());
    int id = p.second;
    assignments[i] = id;
    revAssign[id] = i;
    lefts[i] = le[id];
  }
  SegmentTree st(n, lefts);
  for (int i = 0; i < (n); ++i) {
    int whoIsThere = assignments[i];
    int from = i + 1;
    int to = ri[whoIsThere];
    auto p = st.get(from, to + 1);
    if (p.first >= from) {
      continue;
    }
    out << "NO\n";
    outVec(out, incOne(revAssign));
    swap(revAssign[assignments[i]], revAssign[assignments[p.second]]);
    outVec(out, incOne(revAssign));
    return;
  }
  out << "YES\n";
  outVec(out, incOne(revAssign));
}
int main() {
  solve(cin, cout);
  return 0;
}
