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 
4
3 4
1 2
3 4
1 2
 4
2 4
1 3
4 4
1 1
 10
6 6
1 2
2 2
6 7
8 8
3 5
5 5
4 4
8 9
10 10
 4
1 4
1 4
2 4
1 2
 8
3 4
7 8
2 6
1 3
6 7
5 8
4 6
8 8
 7
7 7
2 3
2 3
5 7
5 6
4 4
1 2
 15
2 2
10 11
2 5
6 7
7 12
9 9
2 3
5 14
1 3
10 10
15 15
12 12
5 6
6 6
14 15
 5
1 3
4 4
5 5
1 4
1 5
 4
1 4
2 3
2 3
4 4
 4
1 4
1 4
1 2
1 4
 5
1 3
1 3
1 5
3 4
1 5
 3
1 3
2 2
1 3
 5
4 4
1 4
3 4
1 3
3 5
 3
1 3
1 2
2 3
 4
2 4
1 3
2 3
1 2
 5
4 5
4 5
1 3
1 2
2 4
 6
2 6
4 6
6 6
2 2
3 3
1 3
 3
2 3
1 2
1 3
 6
4 6
1 3
4 6
4 4
1 4
1 2
 7
3 6
6 6
5 7
2 4
2 3
1 2
3 5
 8
4 6
8 8
1 4
4 5
6 8
1 2
3 6
1 4
 6
2 4
2 6
4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5 1 2 3
 NO
4 5 6 2 3 1 
5 4 6 2 3 1 
 NO
2 1 3 
3 1 2 
 NO
5 2 6 4 3 1 
5 1 6 4 3 2 
 NO
5 6 7 3 2 1 4 
5 6 7 2 3 1 4  NO
5 8 2 4 7 1 6 3
5 8 1 4 7 2 6 3
 NO
2 5 4 3 6 1 
3 5 4 2 6 1  YES
4 7 3 6 8 5 1 2  NO
4 2 3 1
4 1 3 2
 YES
9 4 1 5 7 6 8 3 10 2  NO
3 4 2 1 
2 4 3 1  YES
1  NO
4 7 2 5 1 3 6 8 
5 7 2 4 1 3 6 8  YES
3 4 2 1 5  NO
1 2 3 4 
1 3 2 4 
 NO
3 4 2 1 
4 3 2 1 
 NO
1 2 
2 1 
 YES
3 4 2 1 6 7 5 8  YES
2 3 1 5 4  NO
1 3 4 2 5 6
1 2 4 3 5 6
 NO
1 5 6 3 2 4 
2 5 6 3 1 4 
 NO
4 2 5 1 3 
4 3 5 1 2  NO
1 2 3 
2 1 3 
 NO
1 2 3 4 
4 2 3 1 
 NO
4 1 2 3 5 
3 1 2 4 5 
 NO
2 3 4 1
2 1 4 3
 NO
1 4 5 2 3 6 
1 5 4 2 3 6 
 NO
2 4 5 1 3 
3 4 5 1 2 
 NO
2 1 3 5 4 
3 1 2 5 4  NO
14 13 18 3 7 11 12 2 10 4 8 17 15 9 20 16 6 19 1 5 
14 13 18 3 8 11 12 2 10 4 7 17 15 9 20 16 6 19 1 5 
 NO
1 2 3 4 5 
5 2 3 4 1 
 NO
6 2 1 3 5 4 7
6 1 2 3 5 4 7

#include <bits/stdc++.h>
using namespace std;
long long gesas;
long long inf = 100000000000000000LL;
long long modulo = pow(10, 9) + 7;
double eps = 1e-6;
const long long mod = 998244353;
long long n;
long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
const long long N = 1000000;
const long long sz = (long long)1000000 + 80;
long long S[sz * 4], mx[sz * 4];
vector<long long> vQ[N];
vector<pair<long long, long long> > vC[N];
multiset<pair<long long, long long> > kicikbi;
long long Q;
long long k, indexi = 1, r, z, d, a[N + 2], b[N + 2], insanlar[N + 2], g, m,
             ans = 0, sum = 0, cem = 0, t, last = 0, l, c, x, y, x1, x2, y2;
string he = "YES", yox = "NO";
bool yoxla = 0;
vector<pair<long long, pair<long long, long long> > > araliqlar;
long long minVal(long long xa, long long ya) { return (xa < ya) ? xa : ya; }
long long getMid(long long s, long long e) { return s + (e - s) / 2; }
long long RMQUtil(long long *st, long long ss, long long se, long long qs,
                  long long qe, long long indexi) {
  if (qs <= ss && qe >= se) return st[indexi];
  if (se < qs || ss > qe) return INT_MAX;
  long long mid = getMid(ss, se);
  return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * indexi + 1),
                RMQUtil(st, mid + 1, se, qs, qe, 2 * indexi + 2));
}
long long RMQ(long long *st, long long n, long long qs, long long qe) {
  if (qs < 0 || qe > n - 1 || qs > qe) {
    cout << "Invalid Input";
    return -1;
  }
  return RMQUtil(st, 0, n - 1, qs, qe, 0);
}
long long constructSTUtil(long long arr[], long long ss, long long se,
                          long long *st, long long si) {
  if (ss == se) {
    st[si] = arr[ss];
    return arr[ss];
  }
  long long mid = getMid(ss, se);
  st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),
                  constructSTUtil(arr, mid + 1, se, st, si * 2 + 2));
  return st[si];
}
long long *constructST(long long arr[], long long n) {
  long long x = (long long)(ceil(log2(n)));
  long long max_size = 2 * (long long)pow(2, x) - 1;
  long long *st = new long long[max_size];
  constructSTUtil(arr, 0, n - 1, st, 0);
  return st;
}
vector<pair<long long, long long> > paraliqlar;
long long cananlar[N + 2];
int main() {
  cin >> n;
  araliqlar.push_back(make_pair(0, make_pair(0, 0)));
  for (long long i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    paraliqlar.push_back(make_pair(a[i], b[i]));
    araliqlar.push_back(make_pair(a[i], make_pair(b[i], i)));
  }
  sort(araliqlar.begin(), araliqlar.end());
  for (long long i = 1; i <= n; i++) {
    while (indexi <= n && araliqlar[indexi].first <= i)
      kicikbi.insert(
          {araliqlar[indexi].second.first, araliqlar[indexi].second.second}),
          indexi++;
    insanlar[i] = (*kicikbi.begin()).second, kicikbi.erase(kicikbi.begin());
    cananlar[insanlar[i]] = i;
  }
  long long arr[N + 2];
  for (long long i = 0; i < n; i++) arr[i] = a[insanlar[i + 1]];
  long long cn = sizeof(arr) / sizeof(arr[0]);
  long long *st = constructST(arr, cn);
  long long qs, qe;
  l = 0;
  for (long long j = 1; j < n; ++j) {
    qs = j, qe = b[insanlar[j]] - 1;
    cem = RMQ(st, cn, qs, qe);
    if (cem <= qs) {
      l = j;
      break;
    }
  }
  if (!l) {
    cout << he << "\n";
    for (long long i = 1; i <= n; ++i) {
      cout << cananlar[i] << ' ';
    }
    cout << "\n";
    return 0;
  }
  cout << yox << "\n";
  return 0;
}
