Problem: 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 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n, a[206000], b[206000], ans[206000], p[206000];
vector<pair<int, int> > v[206000];
struct node {
  int id, val;
} tree[1009000];
void build(int i, int l, int r) {
  if (l == r) {
    tree[i].id = l;
    tree[i].val = a[p[l]];
    return;
  }
  int mid = (l + r) >> 1;
  build(i << 1, l, mid);
  build(i << 1 | 1, mid + 1, r);
  if (tree[i << 1].val < tree[i << 1 | 1].val)
    tree[i] = tree[i << 1];
  else
    tree[i] = tree[i << 1 | 1];
}
node q;
void query(int i, int l, int r, int x, int y) {
  if (r < x || l > y) return;
  if (r <= y && x <= l) {
    if (tree[i].val < q.val) q = tree[i];
    return;
  }
  int mid = (l + r) >> 1;
  query(i << 1, l, mid, x, y);
  query(i << 1 | 1, mid + 1, r, x, y);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    a[i] = l;
    b[i] = r;
    v[l].push_back(make_pair(r, i));
  }
  set<pair<int, int> > st;
  for (int i = 1; i <= n; ++i) {
    st.insert(v[i].begin(), v[i].end());
    int y = (*st.begin()).second;
    st.erase(st.begin());
    ans[y] = i;
    p[i] = y;
  }
  build(1, 1, n);
  for (int i = 1; i <= n; ++i) {
    if (i + 1 > b[p[i]]) continue;
    q.val = 99999999;
    query(1, 1, n, i + 1, b[p[i]]);
    if (q.val <= i) {
      cout << "NO" << endl;
      for (int j = 1; j <= n; ++j) printf("%d%c", ans[j], j == n ? '\n' : ' ');
      swap(ans[p[i]], ans[p[q.id]]);
      for (int j = 1; j <= n; ++j) printf("%d%c", ans[j], j == n ? '\n' : ' ');
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  return 0;
}