#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b;
  vector<vector<int> > adjlist;
  adjlist.assign(n + 1, vector<int>());
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    adjlist[a].push_back(b);
    adjlist[b].push_back(a);
  }
  int coun = 0;
  for (int i = 1; i <= n; i++) {
    if (adjlist[i].size() > 2) coun++;
  }
  if (coun <= 1) {
    cout << "Yes" << '\n';
    if (coun == 1) {
      int u;
      int l = 0;
      for (int i = 1; i <= n; i++) {
        if (adjlist[i].size() > 2) u = i;
        if (adjlist[i].size() == 1) l++;
      }
      cout << l << '\n';
      for (int i = 1; i <= n; i++) {
        if (adjlist[i].size() == 1) {
          cout << u << " " << i << '\n';
        }
      }
    } else {
      vector<int> vi;
      for (int i = 1; i <= n; i++) {
        if (adjlist[i].size() == 1) vi.push_back(i);
      }
      cout << 1 << '\n';
      cout << vi[0] << " " << vi[1];
    }
  } else {
    cout << "No";
  }
  return 0;
}
