#include <bits/stdc++.h>
using namespace std;
std::vector<int> v[200005];
void dfs(int par, int x) {
  for (int i = 0; i < v[x].size(); i++) {
    if (par == 0) cout << x << " ";
    int z = v[x][i];
    if (z != par) {
      dfs(x, z);
    } else {
      if (v[x].size() == 1) cout << x << endl;
    }
  }
}
int main() {
  int n, x, y;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int start = -1;
  int sz = -1;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() > 2) {
      if (start == -1) {
        start = i;
        sz = v[i].size();
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  if (start == -1) {
    start = 1;
    cout << v[start].size() << endl;
  } else
    cout << sz << endl;
  dfs(0, start);
  return 0;
}
