#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
inline int read() {
  register int x = 0;
  register char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0', c = getchar();
  return x;
}
int n;
int a[N], mx[N], book[N];
int main() {
  n = read();
  for (int i = 1, u, v; i < n; ++i) {
    u = read();
    v = read();
    if (u < v) swap(u, v);
    if (u != n) {
      puts("NO");
      return 0;
    }
    mx[i] = v;
  }
  sort(mx + 1, mx + n);
  for (int i = 1; i <= n; ++i) {
    if (mx[i] != mx[i - 1])
      a[i] = mx[i], book[a[i]] = 1;
    else {
      for (int j = 1; j <= mx[i]; ++j)
        if (!book[j]) {
          a[i] = j;
          book[j] = 1;
          goto bk;
        }
      puts("NO");
      return 0;
    bk:;
    }
  }
  puts("YES");
  a[n] = n;
  for (int i = 1; i < n; ++i) cout << a[i] << ' ' << a[i + 1] << '\n';
  return 0;
}
