#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)(1e6 + 7);
int n, a, b, deg[MAXN];
vector<int> adj[MAXN];
int hasAns() {
  int cnt = 0, u = 0;
  for (int i = 1; i <= n; i++) {
    if (deg[i] > 2) {
      cnt++;
      u = i;
    }
  }
  if (u == 0) {
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 2) {
        u = i;
        break;
      }
    }
  }
  if (cnt <= 1) return u;
  return 0;
}
void solve() {
  for (int i = 0; i < MAXN; i++) {
    adj[i].clear();
    deg[i] = 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  if (n == 2) {
    cout << "Yes" << endl;
    cout << 1 << endl;
    cout << 1 << " " << 2 << endl;
    return;
  }
  int st = hasAns();
  if (st) {
    cout << "Yes" << endl;
    cout << deg[st] << endl;
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 1) {
        cout << i << " " << st << endl;
      }
    }
  } else {
    cout << "No" << endl;
  }
}
int main() {
  while (cin >> n) {
    solve();
  }
  return 0;
}
