#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  bool t = false;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = true, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return t ? -x : x;
}
int a[1010], n, b[1010], ans[1010], S[1010], top, tot;
int main() {
  n = read();
  for (int i = 1; i < n; ++i) {
    int x = read(), y = read();
    if (x > y) swap(x, y);
    if (y != n || (x == y)) {
      puts("NO");
      return 0;
    }
    a[i] = x;
  }
  sort(&a[1], &a[n]);
  for (int i = 1; i < n; ++i) b[a[i]]++;
  for (int i = 1; i < n; ++i)
    if (!b[i]) S[++top] = i;
  for (int i = 1; i < n; ++i)
    if (a[i] < i) {
      puts("NO");
      return 0;
    }
  for (int i = 1, j, lst = 0; i < n; i = j + 1) {
    j = i;
    while (j < n - 1 && a[j + 1] == a[i]) ++j;
    ans[++tot] = a[i];
    for (int p = 1; p <= j - i; ++p) ans[++tot] = S[++lst];
  }
  ans[++tot] = n;
  puts("YES");
  for (int i = 2; i <= n; ++i) printf("%d %d\n", ans[i - 1], ans[i]);
  return 0;
}
