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 maxn = 4e5 + 5;
int n, m, k;
int a[maxn], p[maxn], x[maxn], y[maxn];
int tmp, cnt;
int flag;
int ans[maxn];
vector<pair<int, int> > vc[maxn];
struct node {
  int id, val;
} c[maxn << 1];
template <typename T>
inline void read(T &X) {
  X = 0;
  int w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  if (w) X = -X;
}
void build(int rt, int l, int r) {
  if (l == r) {
    c[rt].id = p[l];
    c[rt].val = x[p[l]];
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build(rt << 1 | 1, mid + 1, r);
  if (c[rt << 1].val < c[rt << 1 | 1].val)
    c[rt] = c[rt << 1];
  else
    c[rt] = c[rt << 1 | 1];
}
pair<int, int> query(int rt, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) {
    return make_pair(c[rt].val, c[rt].id);
  }
  int mid = (l + r) >> 1;
  pair<int, int> tmp1, tmp2;
  tmp1.first = -1;
  tmp2.first = -1;
  if (ql <= mid) tmp1 = query(rt << 1, l, mid, ql, qr);
  if (qr > mid) tmp2 = query(rt << 1 | 1, mid + 1, r, ql, qr);
  if (tmp1.first == -1) return tmp2;
  if (tmp2.first == -1) return tmp1;
  if (tmp1.first > tmp2.first) return tmp2;
  return tmp1;
}
void prt() {
  for (register int i = (1); i <= (n); i++)
    printf("%d%c", ans[i], i == n ? '\n' : ' ');
}
int main() {
  read(n);
  for (register int i = (1); i <= (n); i++) {
    int l, r;
    read(l);
    read(r);
    x[i] = l;
    y[i] = r;
    vc[l].push_back(make_pair(r, i));
  }
  set<pair<int, int> > st;
  for (register int i = (1); i <= (n); i++) {
    st.insert(vc[i].begin(), vc[i].end());
    int y = (*st.begin()).second;
    st.erase(st.begin());
    ans[y] = i;
    p[i] = y;
  }
  build(1, 1, n);
  for (register int i = (1); i <= (n); i++) {
    if (i + 1 > y[p[i]]) continue;
    pair<int, int> k = query(1, 1, n, i + 1, y[p[i]]);
    if (k.first <= i) {
      puts("NO");
      prt();
      swap(ans[p[i]], ans[k.second]);
      prt();
      return 0;
    }
  }
  puts("YES");
  prt();
  return 0;
}
