#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 2) {
    printf("%s\n", "Yes");
    printf("%d\n", 1);
    printf("%d %d\n", 1, 2);
    return 0;
  }
  vector<int> v[100000];
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  multimap<int, int> d;
  for (int i = 0; i < n; i++) {
    int x = v[i].size();
    d.insert(make_pair(x, i));
  }
  auto itr = d.upper_bound(2);
  if (itr == d.end()) {
    printf("%s\n", "Yes");
    printf("%d\n", 1);
    auto itr1 = d.begin();
    auto itr2 = itr1;
    itr2++;
    printf("%d %d\n", itr1->second + 1, itr2->second + 1);
  } else {
    int d0 = itr->first, v0 = itr->second;
    itr++;
    if (itr != d.end()) {
      printf("%s\n", "No");
    } else {
      int c = d.count(1);
      printf("%s\n", "Yes");
      printf("%d\n", c);
      for (auto itr1 = d.lower_bound(1); itr1 != d.upper_bound(1); itr1++) {
        int v1 = itr1->second;
        printf("%d %d\n", v0 + 1, v1 + 1);
      }
    }
  }
  return 0;
}
