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 int N = 2e5 + 5;
struct Node {
  int l, r, id;
  bool operator<(const Node &b) const { return l < b.l; }
} a[N], b[N];
priority_queue<pair<int, int> > q;
int ans[N], p[N], mi[N * 4], id[N * 4];
inline void update(int x) {
  mi[x] = mi[x << 1 | (mi[x << 1] > mi[x << 1 | 1])],
  id[x] = id[x << 1 | (mi[x << 1] > mi[x << 1 | 1])];
}
void build(int l, int r, int x) {
  if (l == r) {
    mi[x] = b[p[l]].l, id[x] = l;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, x << 1);
  build(mid + 1, r, x << 1 | 1);
  update(x);
}
pair<int, int> query(int x, int l, int r, int L, int R) {
  if (L <= l && R >= r) return {mi[x], id[x]};
  int mid = (l + r) >> 1;
  pair<int, int> w1 = {1e9, 0}, w2 = {1e9, 0};
  if (L <= mid) w1 = query(x << 1, l, mid, L, R);
  if (R > mid) w2 = query(x << 1 | 1, mid + 1, r, L, R);
  if (w1.first < w2.first) return w1;
  return w2;
}
int main() {
  int n, l = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%d%d", &a[i].l, &a[i].r), a[i].id = i, b[i] = a[i];
  sort(a, a + n);
  for (int i = 1; i <= n; i++) {
    while (l < n && a[l].l <= i) q.push({-a[l].r, a[l].id}), l++;
    p[i] = q.top().second;
    q.pop();
    ans[p[i]] = i;
  }
  build(1, n, 1);
  int u = -1, v;
  for (int i = 1; i <= n; i++) {
    if (b[p[i]].r == i) continue;
    pair<int, int> w = query(1, 1, n, i + 1, b[p[i]].r);
    if (w.first <= i) {
      u = p[i], v = p[w.second];
      break;
    }
  }
  if (u == -1) {
    puts("YES");
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  } else {
    puts("NO");
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
    swap(ans[u], ans[v]);
    puts("");
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  }
  return 0;
}
