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;
const long long INF = 1000000000;
struct edge {
  long long to, cost;
  edge(int a, int b) : to(a), cost(b) {}
};
void debug(vector<int>& db) {
  for (auto x : db) cout << x << " ";
  cout << endl;
}
long long mod = 1000000007;
long long my_pow(long long a, long long b) {
  long long re = 1;
  while (b) {
    if (b & 1) re = (re * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return re;
}
struct P {
  int l, r, idx;
  P(int tl, int tr, int tidx) : l(tl), r(tr), idx(tidx) {}
};
struct cmp {
  bool operator()(const P& a, const P& b) { return a.l < b.l; }
} cmp;
struct setcmp {
  bool operator()(const P& a, const P& b) { return a.r < b.r; }
};
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int n;
  cin >> n;
  vector<P> da;
  multiset<P, setcmp> sp;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    da.push_back(P(l, r, i));
  }
  sort(da.begin(), da.end(), cmp);
  vector<P> vp;
  vector<int> ans(n);
  int now = 0;
  for (int i = 1; i <= n; i++) {
    while (now < n && da[now].l <= i) {
      sp.insert(da[now++]);
    }
    vp.push_back(*sp.begin());
    sp.erase(sp.begin());
  }
  for (int i = 0; i < n; i++) {
    ans[vp[i].idx] = i + 1;
  }
  map<int, pair<int, int>, greater<int>> mp;
  for (int i = 0; i < n; i++) {
    while (mp.begin() != mp.end() && mp.begin()->second.second < i + 1)
      mp.erase(mp.begin());
    if (mp.begin() != mp.end() && vp[i].l <= mp.begin()->first) {
      cout << "NO" << endl;
      debug(ans);
      swap(ans[vp[i].idx], ans[mp.begin()->second.first]);
      debug(ans);
      return 0;
    }
    if (mp.find(i + 1) == mp.end())
      mp[i + 1] = {vp[i].idx, vp[i].r};
    else if (mp[i + 1].second < vp[i].r)
      mp[i + 1] = {vp[i].idx, vp[i].r};
  }
  cout << "YES" << endl;
  debug(ans);
}