#include <bits/stdc++.h>
using namespace std;
int n, du[100010];
int yz[100010], tot, ans, maxn;
int main() {
  scanf("%d", &n);
  for (int x, y, i = 1; i < n; i++) scanf("%d%d", &x, &y), du[x]++, du[y]++;
  for (int i = 1; i <= n; i++)
    if (du[i] == 1) yz[++tot] = i;
  if (tot == 2) {
    printf("Yes\n");
    printf("1\n%d %d", yz[1], yz[2]);
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (maxn < du[i]) maxn = du[i], ans = i;
  bool q = 0;
  for (int i = 1; i <= n; i++) {
    if (i == ans) continue;
    if (du[i] > 2) {
      printf("No");
      return 0;
    }
  }
  printf("Yes\n%d\n", tot);
  for (int i = 1; i <= tot; i++) printf("%d %d\n", ans, yz[i]);
}
