#include <bits/stdc++.h>
using namespace std;
int d[100000];
vector<int> E[100000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    d[a]++, d[b]++;
    E[a].push_back(b), E[b].push_back(a);
  }
  int c = 0;
  for (int i = 0; i < n; i++) c += (d[i] >= 3);
  if (c > 1) cout << "No" << endl, exit(0);
  if (c == 0) {
    int f[100000];
    memset(f, 0, sizeof f);
    int u;
    for (int i = 0; i < n; i++)
      if (d[i] == 1) u = i;
    cout << "Yes" << endl;
    cout << 1 << endl;
    int x = 1;
    f[u] = 1;
    cout << u + 1;
    while (x < n) {
      for (int i = 0; i < E[u].size(); i++)
        if (!f[E[u][i]]) {
          u = E[u][i];
          x++;
          f[u] = 1;
          continue;
        }
    }
    cout << ' ' << u + 1 << endl;
  } else {
    int f[100000];
    memset(f, 0, sizeof f);
    int u;
    for (int i = 0; i < n; i++)
      if (d[i] >= 3) u = i;
    cout << "Yes" << endl;
    cout << d[u] << endl;
    f[u] = 1;
    for (int w = 0; w < E[u].size(); w++) {
      cout << u + 1;
      int v = E[u][w];
      f[v] = 1;
      while (d[v] > 1) {
        for (int i = 0; i < E[v].size(); i++)
          if (!f[E[v][i]]) {
            v = E[v][i];
            f[v] = 1;
            continue;
          }
      }
      cout << ' ' << v + 1 << endl;
    }
  }
  return 0;
}
