#include <bits/stdc++.h>
using namespace std;
int n, u, v, cou = 0, r = -1, re, le, ri;
vector<int> q;
vector<vector<int> > edge;
vector<bool> leaf, visit;
int main() {
  scanf("%d", &n);
  edge.resize(n + 1);
  visit.resize(n + 1);
  for (int i = (1); i < (n + 1); i++) {
    edge[i].resize(0);
    visit[i] = false;
  }
  for (int i = (0); i < (n - 1); i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  for (int i = (1); i < (n + 1); i++)
    if (edge[i].size() > 2) {
      cou++;
      r = i;
    }
  if (cou > 1) {
    printf("No");
    return 0;
  }
  if (r == -1) r = 1;
  leaf.resize(n + 1);
  for (int i = (1); i < (n + 1); i++) leaf[i] = true;
  q.resize(0);
  q.push_back(r);
  le = -1;
  ri = 0;
  visit[r] = true;
  while (++le <= ri) {
    u = q[le];
    for (int i = (0); i < (edge[u].size()); i++) {
      v = edge[u][i];
      if (visit[v] == false) {
        visit[v] = true;
        leaf[u] = false;
        q.push_back(v);
        ri++;
      }
    }
  }
  for (int i = (1); i < (n + 1); i++)
    if (leaf[i]) re++;
  printf("Yes\n");
  printf("%d\n", re);
  for (int i = (1); i < (n + 1); i++)
    if (leaf[i]) {
      printf("%d %d\n", i, r);
    }
  return 0;
}
