#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int P = 998244353;
struct edge {
  int v;
  edge *next;
} pool[2 * N + 5], *h[N];
int n, top = -1;
int deg[N], leaf;
void addedge(int u, int v) {
  edge *tmp = &pool[++top];
  tmp->v = v;
  tmp->next = h[u];
  h[u] = tmp;
}
void init() {
  int x1, x2;
  scanf("%d", &n);
  if (n == 2) {
    printf("Yes\n1\n1 2\n");
    return;
  }
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x1, &x2);
    addedge(x1, x2);
    addedge(x2, x1);
    deg[x1]++;
    deg[x2]++;
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) leaf++;
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] == leaf) {
      printf("Yes\n");
      printf("%d\n", leaf);
      for (int j = 1; j <= n; j++) {
        if (deg[j] == 1) {
          printf("%d %d\n", i, j);
        }
      }
      return;
    }
  }
  printf("No\n");
}
int main(int argc, char **argv) {
  init();
  return 0;
}
