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;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int maxn = 2e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n;
int a[maxn], b[maxn], pos[maxn], rpos[maxn];
vector<int> in[maxn], out[maxn];
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    a[i] = read(), b[i] = read();
    in[a[i]].push_back(i);
  }
  set<pair<int, int> > s;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < in[i].size(); ++j)
      s.insert(pair<int, int>(b[in[i][j]], in[i][j]));
    pair<int, int> now = *s.begin();
    s.erase(s.begin());
    pos[rpos[i] = now.second] = i;
  }
  vector<int> v1, v2;
  for (int i = 1; i <= n; ++i) v1.push_back(pos[i]);
  s.clear();
  for (int i = 1; i <= n; ++i) out[b[i]].push_back(i);
  for (int i = 1; i <= n; ++i) assert(b[i] >= pos[i]);
  for (int i = 1; i <= n; ++i) {
    if (s.size()) {
      if (s.rbegin()->first >= a[rpos[i]]) {
        swap(pos[s.rbegin()->second], pos[rpos[i]]);
        break;
      }
    }
    s.insert(pair<int, int>(i, rpos[i]));
    for (int j = 0; j < out[i].size(); ++j) {
      assert(s.find(pair<int, int>(pos[out[i][j]], out[i][j])) != s.end());
      s.erase(s.find(pair<int, int>(pos[out[i][j]], out[i][j])));
    }
  }
  for (int i = 1; i <= n; ++i) v2.push_back(pos[i]);
  if (v1 != v2) {
    printf("NO\n");
    for (int i = 0; i < v1.size(); ++i) printf("%d ", v1[i]);
    puts("");
    for (int i = 0; i < v2.size(); ++i) printf("%d ", v2[i]);
    puts("");
  } else {
    printf("YES\n");
    for (int i = 0; i < v1.size(); ++i) printf("%d ", v1[i]);
    puts("");
  }
}
