#include <bits/stdc++.h>
using namespace std;
struct node {
  int next;
  int to;
  int from;
} a[1000000];
int head[1000000];
bool vis[1000000];
int degree[1000000];
int tot;
int n;
int ans[1000000];
int ansn;
int root;
inline void init() {
  tot = 0;
  for (int i = 1; i <= n; i++) {
    head[i] = 0;
    degree[i] = 0;
    vis[i] = false;
  }
}
inline void addedge(int x, int y) {
  tot++;
  a[tot].next = head[x];
  a[tot].to = y;
  a[tot].from = x;
  head[x] = tot;
  tot++;
  a[tot].next = head[y];
  a[tot].to = x;
  a[tot].from = y;
  head[y] = tot;
  degree[x]++;
  degree[y]++;
}
void dfs(int x) {
  vis[x] = true;
  if (degree[x] == 1 && x != root) {
    ansn++;
    ans[ansn] = x;
    return;
  }
  for (int p = head[x]; p != 0; p = a[p].next) {
    int v = a[p].to;
    if (!vis[v]) {
      dfs(v);
    }
  }
  return;
}
int main() {
  scanf("%d", &n);
  init();
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    addedge(x, y);
  }
  bool pd = true;
  root = 0;
  for (int i = 1; i <= n; i++) {
    if (degree[i] >= 3) {
      if (root == 0) {
        root = i;
      } else {
        pd = false;
      }
    }
  }
  if (root == 0) {
    root = 1;
  }
  if (!pd) {
    printf("No\n");
  } else {
    ansn = 0;
    dfs(root);
    printf("Yes\n");
    printf("%d\n", ansn);
    for (int i = 1; i <= ansn; i++) {
      printf("%d %d\n", root, ans[i]);
    }
  }
  return 0;
}
