#include <bits/stdc++.h>
const int N = 2005;
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int org[N], a[N];
pair<int, int> e[N];
set<int> s;
bool CMP(int x, int y) { return x > y; }
int main() {
  int n, P = 1, last = 1, x, y, tot = 0;
  cin >> n;
  org[1] = n;
  for (int i = 1; i < n; i++) {
    x = read();
    y = read();
    if (x < y) swap(x, y);
    if (x == y || x != n) {
      printf("NO");
      return 0;
    }
    a[i] = y;
  }
  for (int i = 1; i < n; i++) s.insert(-i);
  for (int i = 1; i < n; i++)
    if (s.count(-a[i])) s.erase(-a[i]);
  sort(a + 1, a + n, CMP);
  for (int i = 1, j = i; i < n; i = j) {
    for (j = i + 1; j < n && a[j] == a[i]; j++)
      ;
    int pos = P, be = i, en = j;
    for (int k = i + 1; k < j; k++) {
      if (!s.size() || -*s.begin() > a[i]) {
        printf("NO");
        return 0;
      }
      org[++P] = -*s.begin();
      e[++tot] = make_pair(last, P);
      last = P;
      s.erase(s.begin());
    }
    org[++P] = a[i];
    e[++tot] = make_pair(last, P);
    last = pos + 1;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= tot; i++)
    cout << org[e[i].first] << ' ' << org[e[i].second] << endl;
  return 0;
}
