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>
class Segtree {
 private:
  std::vector<int> t_;
  int n_;

 public:
  int Query(int n, int lft, int rgt, int rs, int re) {
    if (lft >= rs && rgt <= re) return t_[n];
    if (lft > re || rgt < rs) return 0;
    const int mid = (lft + rgt) / 2;
    return std::max(Query(2 * n, lft, mid, rs, re),
                    Query(2 * n + 1, mid + 1, rgt, rs, re));
  }
  void Set(int n, int lft, int rgt, int pt, int v) {
    if (lft == rgt) {
      t_[n] = v;
      return;
    }
    const int mid = (lft + rgt) / 2;
    if (pt <= mid) {
      Set(2 * n, lft, mid, pt, v);
    } else {
      Set(2 * n + 1, mid + 1, rgt, pt, v);
    }
    t_[n] = std::max(t_[2 * n], t_[2 * n + 1]);
  }
  Segtree(int n) : n_(n), t_(4 * n + 1) {}
};
template <typename T>
void print_vector(const std::vector<T>& v, int lo, int hi,
                  bool newline = true) {
  while (lo <= hi) {
    std::cout << v[lo++] << ' ';
  }
  if (newline) {
    std::cout << '\n';
  }
}
void Run() {
  int n;
  std::cin >> n;
  std::vector<std::array<int, 2>> inter(n);
  std::vector<std::vector<int>> start(n + 1);
  std::vector<int> greed(n + 1);
  std::vector<int> who(n + 1);
  for (int i = 0; i < n; ++i) {
    std::cin >> inter[i][0] >> inter[i][1];
    start[inter[i][0]].push_back(i);
  }
  std::set<std::pair<int, int>> by_end;
  for (int i = 1; i <= n; ++i) {
    for (int j : start[i]) {
      by_end.emplace(inter[j][1], j);
    }
    greed[by_end.begin()->second] = i;
    who[i] = by_end.begin()->second;
    by_end.erase(by_end.begin());
  }
  Segtree t(n + 1);
  for (int i = 1; i <= n; ++i) {
    std::array<int, 2> interval = inter[who[i]];
    if (t.Query(1, 0, n - 1, interval[0], i) >= i) {
      std::cout << "NO\n";
      print_vector(greed, 0, n - 1);
      for (int j = interval[0]; j <= i; ++j) {
        if (inter[who[j]][1] >= i) {
          std::swap(greed[who[j]], greed[who[i]]);
          print_vector(greed, 0, n - 1);
          return;
        }
      }
      assert(false);
    }
    t.Set(1, 0, n - 1, i, interval[1]);
  }
  std::cout << "YES\n";
  print_vector(greed, 0, n - 1);
}
int main() {
  srand(time(0));
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  Run();
  return 0;
}
