#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int g[N][N];
int vis[N];
int cnt[N];
void solve() {
  int n, a, b;
  cin >> n;
  for (__typeof((n - 1)) i = (1); i <= (n - 1); i++) {
    cin >> a >> b;
    if (a < b) swap(a, b);
    if (a != n) {
      cout << "NO" << '\n';
      return;
    }
    cnt[b]++;
  }
  for (__typeof((n - 1)) i = (1); i <= (n - 1); i++) {
    int x = cnt[i];
    if (x == 0) continue;
    int c = 0;
    int l = n;
    for (__typeof((i - 1)) j = (i - 1); j >= (1); j--) {
      if (vis[j]) continue;
      if (c == x - 1) break;
      c++;
      g[l][j] = 1;
      vis[j] = 1;
      l = j;
    }
    vis[i] = 1;
    if (i > l)
      g[i][l] = 1;
    else
      g[l][i] = 1;
    if (c != x - 1) {
      cout << "NO" << '\n';
      return;
    }
  }
  cout << "YES" << '\n';
  for (__typeof((n)) i = (1); i <= (n); i++) {
    for (__typeof((i - 1)) j = (1); j <= (i - 1); j++) {
      if (g[i][j]) {
        cout << i << " " << j << '\n';
      }
    }
  }
}
signed main() {
  int t;
  ios_base::sync_with_stdio(false);
  t = 1;
  while (t--) solve();
  return 0;
}
