#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, x, y;
  cin >> n;
  map<long, long> m;
  n--;
  while (n--) {
    cin >> x >> y;
    m[x]++;
    m[y]++;
  }
  bool flag = 1;
  set<long> q;
  x = -1;
  for (auto i : m)
    if (i.second >= 3) {
      x = i.first;
      if (flag == 0) {
        cout << "No";
        return 0;
      } else
        flag = 0;
    } else if (i.second == 1)
      q.insert(i.first);
  cout << "Yes\n";
  if (x == -1) {
    cout << "1\n";
    cout << *q.begin() << " " << *q.rbegin() << "\n";
  } else {
    cout << q.size() << "\n";
    for (auto i : q) cout << x << " " << i << "\n";
  }
}
