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 unsigned long long INF = 1e17;
const int INFi = 2e7;
const int Y = 200100;
const long long m = 1000000007;
template <typename T>
inline T getint() {
  T val = 0;
  char c;
  bool neg = false;
  while ((c = getchar()) && !(c >= '0' && c <= '9')) {
    neg |= c == '-';
  }
  do {
    val = (val * 10) + c - '0';
  } while ((c = getchar()) && (c >= '0' && c <= '9'));
  return val * (neg ? -1 : 1);
}
struct Cyst {
  int l;
  int r;
  Cyst(long long L = 0, long long R = 0) {
    l = L;
    r = R;
  }
};
vector<pair<int, int>> End[Y];
vector<int> BG[Y];
bool vis[Y];
int ID[Y];
int ans1[Y];
int ans2[Y];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  bool aa = true;
  for (int i = 1; i <= n; ++i) {
    int l, r;
    cin >> l >> r;
    End[l].push_back({r, i});
  }
  set<pair<int, int>> sp;
  for (int i = 1; i <= n; ++i) {
    for (auto x : End[i]) {
      sp.insert(x);
    }
    pair<int, int> T = *sp.begin();
    sp.erase(sp.begin());
    ans1[T.second] = i;
    ID[i] = T.second;
  }
  int id1 = -1, id2 = -1;
  for (int i = 1; i <= n; ++i) {
    ans2[i] = ans1[i];
    for (auto x : End[i]) {
      sp.insert(x);
    }
    pair<int, int> T = *sp.begin();
    sp.erase(sp.begin());
    if (aa && !sp.empty()) {
      pair<int, int> T1 = *sp.begin();
      if (ans1[T1.second] <= T.first) {
        aa = false;
        id1 = T1.second;
        id2 = T.second;
      }
    }
  }
  if (aa) {
    cout << "YES\n";
    for (int i = 1; i <= n; ++i) {
      cout << ans1[i] << " ";
    }
  } else {
    swap(ans2[id1], ans2[id2]);
    cout << "NO\n";
    for (int i = 1; i <= n; ++i) cout << ans1[i] << " ";
    cout << endl;
    for (int i = 1; i <= n; ++i) cout << ans2[i] << " ";
  }
  return 0;
}
