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;
const long long N = 2e5 + 5;
long long n;
vector<vector<pair<long long, long long> > > g(N);
pair<long long, long long> f[N];
long long match[N], match2[N];
long long vis[N], nxt[N];
set<long long> active;
vector<long long> genPerfect() {
  vector<long long> ret(n);
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      pq;
  for (long long i = (long long)1; i <= (long long)n; i++) {
    for (auto it : g[i]) pq.push(it);
    while (!pq.empty() && pq.top().first < i) pq.pop();
    ret[pq.top().second - 1] = i;
    pq.pop();
  }
  return ret;
}
void foundCycle(long long root) {
  cout << "NO" << '\n';
  vector<long long> ans1(n + 1), ans2(n + 1);
  for (long long i = (long long)1; i <= (long long)n; i++) ans1[i] = match[i];
  long long u = root;
  while (true) {
    match[u] = ans1[nxt[u]];
    u = nxt[u];
    if (u == root) break;
  }
  for (long long i = (long long)1; i <= (long long)n; i++) ans2[i] = match[i];
  for (long long i = (long long)1; i <= (long long)n; i++)
    cout << ans1[i] << ' ';
  cout << '\n';
  for (long long i = (long long)1; i <= (long long)n; i++)
    cout << ans2[i] << ' ';
  cout << '\n';
  exit(0);
}
void dfs(long long u) {
  vector<long long> done;
  vis[u] = 1;
  while (true) {
    auto it = active.lower_bound(f[u].first);
    if (it != active.end() && *it == match[u]) {
      done.push_back(*it);
      it++;
    }
    if (it == active.end() || *it > f[u].second) break;
    long long v = *it;
    done.push_back(v);
    assert(vis[match2[v]] != 2);
    nxt[u] = match2[v];
    if (vis[match2[v]] == 1) {
      foundCycle(match2[v]);
      exit(0);
    }
    dfs(match2[v]);
  }
  vis[u] = 2;
  for (auto it : done)
    if (active.find(it) != active.end()) active.erase(it);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = (long long)1; i <= (long long)n; i++) {
    long long l, r;
    cin >> l >> r;
    g[l].push_back({r, i});
    f[i] = {l, r};
  }
  auto rec1 = genPerfect();
  for (long long i = (long long)0; i <= (long long)n - 1; i++) {
    match[i + 1] = rec1[i];
    match2[rec1[i]] = i + 1;
  }
  for (long long i = (long long)1; i <= (long long)n; i++) active.insert(i);
  for (long long i = (long long)1; i <= (long long)n; i++) {
    if (vis[i] == 0) dfs(i);
  }
  cout << "YES" << '\n';
  for (auto it : rec1) cout << it << ' ';
  cout << '\n';
}
