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;
long long int mod = 1000000007;
long long int INF = 1e18;
long long int po(long long int a, long long int b) {
  long long int re = 1;
  while (b) {
    if (b % 2 == 1) {
      re = (re * a);
      re %= mod;
    }
    a = (a * a);
    a %= mod;
    b >>= 1;
  }
  return re;
}
struct arr {
  int i;
  int a, b;
};
bool che(arr a, arr b) {
  if (a.a == b.a) return a.b < b.b;
  return a.a < b.a;
}
pair<int, int> t[800100];
void update(int v, int tl, int tr, int pos, int new_val, int p) {
  if (tl == tr) {
    t[v] = make_pair(new_val, p);
  } else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update(v * 2, tl, tm, pos, new_val, p);
    else
      update(v * 2 + 1, tm + 1, tr, pos, new_val, p);
    t[v] = min(t[2 * v], t[2 * v + 1]);
  }
  return;
}
pair<int, int> sum(int v, int tl, int tr, int l, int r) {
  if (l > r) return make_pair(1000000, 0);
  if (l == tl && r == tr) {
    return t[v];
  }
  int tm = (tl + tr) / 2;
  return min(sum(v * 2, tl, tm, l, min(r, tm)),
             sum(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
}
int main() {
  int test = 1;
  while (test--) {
    int n;
    cin >> n;
    arr a[n];
    int backup[n];
    for (int i = (0); i < (n); i++) {
      cin >> a[i].a >> a[i].b;
      a[i].i = i;
      backup[i] = a[i].a;
    }
    sort(a, a + n, che);
    pair<int, int> u;
    set<pair<int, int> > fil;
    int ar[n], br[n];
    int j = 0;
    for (int i = (0); i < (n); i++) {
      while (j < n && a[j].a == i + 1) {
        fil.insert(make_pair(a[j].b, a[j].i));
        j++;
      }
      u = *fil.begin();
      fil.erase(u);
      ar[u.second] = i + 1;
      br[u.second] = i + 1;
      update(1, 0, n, i + 1, backup[u.second], u.second);
    }
    bool f = 0;
    for (int i = (0); i < (n); i++) {
      u = sum(1, 0, n, ar[a[i].i] + 1, a[i].b);
      if (u.first <= ar[a[i].i]) {
        swap(br[a[i].i], br[u.second]);
        f = 1;
        break;
      }
    }
    if (f) {
      cout << "NO\n";
      for (int i = (0); i < (n); i++) cout << ar[i] << ' ';
      cout << '\n';
      for (int i = (0); i < (n); i++) cout << br[i] << ' ';
    } else {
      cout << "YES\n";
      for (int i = (0); i < (n); i++) cout << ar[i] << ' ';
    }
  }
  return 0;
}
