#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e5 + 4;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v[n + 4];
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int cnt = 0, ind, ones = 0;
  for (int i = 1; i < n + 1; i++)
    if (v[i].size() > 2) {
      cnt++;
      ind = i;
    } else if (v[i].size() == 1)
      ones++;
  if (cnt > 1) {
    printf("No");
    return 0;
  }
  printf("Yes\n");
  if (cnt == 1) {
    printf("%d\n", ones);
    for (int i = 1; i < n + 1; i++)
      if (v[i].size() == 1) printf("%d %d\n", ind, i);
  } else {
    printf("%d\n", 1);
    for (int i = 1; i < n + 1; i++)
      if (v[i].size() == 1) printf("%d ", i);
  }
  return 0;
}
