#include <bits/stdc++.h>
const int MaxN = 2e5;
using namespace std;
int deg[MaxN + 5];
vector<int> G[MaxN + 5], V;
int n, m, now;
void Init() {
  for (int i = 1; i <= n; i++) G[i].clear();
  V.clear();
  memset(deg, 0, sizeof(deg));
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    deg[u]++;
    deg[v]++;
    G[u].push_back(v);
    G[v].push_back(u);
  }
}
void Dfs(int x, int fa) {
  if (deg[x] > 2) {
    now = x;
    return;
  }
  for (int i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    if (v != fa) {
      Dfs(v, x);
    }
  }
}
void Solve() {
  for (int i = 1; i <= n; i++)
    if (deg[i] == 1) V.push_back(i);
  if ((int)V.size() == 2) {
    printf("Yes\n1\n%d %d\n", V[0], V[1]);
  } else {
    int tmpNode = -1;
    for (int i = 0; i < V.size(); i++) {
      now = -1;
      int v = V[i];
      Dfs(v, -1);
      if (tmpNode == -1)
        tmpNode = now;
      else if (tmpNode != now) {
        printf("No\n");
        return;
      }
    }
    printf("Yes\n");
    printf("%d\n", (int)V.size());
    for (int i = 0; i < V.size(); i++) printf("%d %d\n", tmpNode, V[i]);
  }
}
int main() {
  while (~scanf("%d", &n)) {
    Init();
    Solve();
  }
}
