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;
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    T t = bigmod(p, e / 2, M);
    return (t * t) % M;
  }
  return (bigmod(p, e - 1, M) * p) % M;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T multimod(T a, T b, T m) {
  T res = 0;
  a %= m, b %= m;
  while (b) {
    if (b & 1) res = m - res > a ? (res + a) : (res + a - m);
    b >>= 1;
    a = (m - a) > a ? a + a : a + a - m;
  }
  return (T)res;
}
void sc(int &a) { scanf("%d", &a); }
void sc(long long &a) { scanf("%lld", &a); }
void sc(double &a) { scanf("%lf", &a); }
void sc(int &a, int &b) { scanf("%d %d", &a, &b); }
void sc(long long &a, long long &b) { scanf("%lld %lld", &a, &b); }
void sc(int &a, int &b, int &c) { scanf("%d %d %d", &a, &b, &c); }
void sc(int &a, int &b, long long &c) { scanf("%d %d %lld", &a, &b, &c); }
void sc(long long &a, long long &b, long long &c) {
  scanf("%lld %lld %lld", &a, &b, &c);
}
void sc(string &str) { cin >> str; }
void sc(char *(str)) { scanf(" %s", str); }
void sc(char &c) { scanf(" %c", &c); }
int dr[] = {0, 1, 0, -1};
int dc[] = {1, 0, -1, 0};
struct Z {
  int l, r, p;
  Z() {}
  Z(int _, int __, int ___) {
    l = _;
    r = __;
    p = ___;
  }
  bool operator<(const Z &A) const {
    if (l < A.l)
      return true;
    else if (l > A.l)
      return false;
    return r < A.r;
  }
};
Z arr[(200000 + 7)];
Z save[(200000 + 7)];
int ans[(200000 + 7)];
int can[(200000 + 7)];
int main() {
  int i, t, cases = 1, j, pos;
  int n;
  sc(n);
  for (int i = 0; i < n; i++) {
    sc(arr[i].l, arr[i].r);
    arr[i].l--;
    arr[i].r--;
    arr[i].p = i;
    save[i] = arr[i];
  }
  sort(arr, arr + n);
  set<pair<int, int> > store;
  set<pair<int, int> >::iterator it;
  int ind = 0;
  int p1 = -1, p2 = -1;
  memset(can, -1, sizeof can);
  for (int pos = 0; pos < n; pos++) {
    while (ind < n && arr[ind].l <= pos) {
      store.insert(make_pair(arr[ind].r, arr[ind].p));
      ind++;
    }
    it = store.begin();
    int p = it->second;
    ans[p] = pos;
    store.erase(it);
    if (store.size() > 0) {
      can[p] = store.begin()->second;
    }
  }
  for (int i = 0; i < n; i++) {
    int nxt = can[i];
    if (nxt == -1) continue;
    if (save[i].l <= ans[nxt] && ans[nxt] <= save[i].r) {
      p1 = i;
      p2 = nxt;
    }
  }
  if (p1 == -1) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << ans[i] + 1 << " ";
    }
    cout << "\n";
  } else {
    cout << "NO\n";
    for (int i = 0; i < n; i++) {
      cout << ans[i] + 1 << " ";
    }
    cout << "\n";
    swap(ans[p1], ans[p2]);
    for (int i = 0; i < n; i++) {
      cout << ans[i] + 1 << " ";
    }
    cout << "\n";
  }
  return 0;
}
