#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int deg[n];
  memset(deg, 0, sizeof(deg));
  for (int i = 0; i < (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    deg[u]++;
    deg[v]++;
  }
  int center;
  vector<int> sides;
  bool hascenter = false;
  for (int i = 0; i < (n); i++) {
    if (deg[i] > 2) {
      if (hascenter) return !(cout << "No");
      hascenter = true;
      center = i;
    } else if (deg[i] == 1)
      sides.push_back(i);
  }
  cout << "Yes\n";
  if (hascenter) {
    cout << ((int)(sides).size()) << '\n';
    for (int s : sides) cout << center + 1 << ' ' << s + 1 << '\n';
  } else {
    cout << "1\n" << sides[0] + 1 << ' ' << sides[1] + 1;
  }
}
