#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return a % b ? gcd(b, a % b) : b; }
const long long mod = 1e9 + 7;
const long long inf = 0x3f3f3f3f;
long long qpow(long long a, long long b) {
  long long t = 1;
  while (b != 0) {
    if (b & 1) t = (t * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return t;
}
const int N = 1e3 + 3;
int a[N], b[N];
int n;
int ha[N];
queue<int> q;
vector<pair<int, int> > an;
signed main() {
  cin >> n;
  for (int i = 1; i < n; ++i) cin >> a[i] >> b[i];
  for (int i = 1; i < n; ++i) {
    if (a[i] > b[i]) swap(a[i], b[i]);
  }
  for (int i = 1; i < n; ++i) {
    if (b[i] != n) {
      puts("NO");
      return 0;
    }
  }
  for (int i = 1; i < n; ++i) {
    ha[a[i]]++;
  }
  for (int i = 1; i < n; ++i) {
    if (!ha[i]) {
      q.push(i);
      continue;
    }
    ha[i]--;
    if (ha[i] > q.size()) {
      puts("NO");
      return 0;
    }
    vector<int> t;
    t.push_back(n);
    while (ha[i]--) {
      t.push_back(q.front());
      q.pop();
    }
    t.push_back(i);
    for (int i = 1; i < t.size(); ++i) {
      an.push_back({t[i - 1], t[i]});
    }
  }
  puts("YES");
  for (auto& t : an) {
    cout << t.first << " " << t.second << endl;
  }
  return 0;
}
