#include <bits/stdc++.h>
using namespace std;
int m[100005], arr[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    m[a]++;
    m[b]++;
  }
  int cnt = 0, k = 0;
  int ok = 1, s = 0;
  for (int i = 1; i <= n; i++) {
    if (m[i] >= 3)
      if (cnt == 0) {
        cnt++;
        s = i;
      } else {
        ok = 0;
        break;
      }
    else if (m[i] == 1)
      arr[k++] = i;
  }
  if (!ok)
    printf("No\n");
  else {
    printf("Yes\n");
    if (s == 0) {
      printf("1\n");
      printf("%d %d\n", arr[0], arr[k - 1]);
    } else {
      printf("%d\n", k);
      for (int i = 0; i < k; i++) printf("%d %d\n", s, arr[i]);
    }
  }
  return 0;
}
