func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 10;   int n, ch, x, y;   vector<int> path[maxn];   vector<int> ans;   int main() {     scanf( %d , &n);     for (int i = 1; i < n; i++) {       scanf( %d%d , &x, &y);       path[x].push_back(y);       path[y].push_back(x);     }     ch = 0;     for (int i = 1; i <= n; i++)       if (path[i].size() > 2) {         if (ch == 0)           ch = i;         else {           puts( No );           return 0;         }       }     if (ch == 0) {       puts( Yes );       puts( 1 );       x = y = 0;       for (int i = 1; i <= n; i++)         if (path[i].size() == 1) {           if (x == 0)             x = i;           else             y = i;         }       printf( %d %d n , x, y);     } else {       puts( Yes );       ans.clear();       for (int i = 1; i <= n; i++)         if (path[i].size() == 1) ans.push_back(i);       printf( %d n , ans.size());       for (int i = 0; i < ans.size(); i++) printf( %d %d n , ch, ans[i]);     }     return 0;   }   