#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
vector<int> adj[N];
int n;
int main(void) {
  scanf("%d", &n);
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (n == 2) {
    printf("Yes\n");
    printf("1\n");
    printf("1 2\n");
    return 0;
  }
  int maxdeg = 0, id = 0, cnt = 0;
  vector<int> leafs;
  for (int u = 1; u <= n; u++) {
    if (adj[u].size() == 1) {
      leafs.push_back(u);
    }
    if (adj[u].size() > 2) {
      cnt++;
    }
    if (adj[u].size() > maxdeg) {
      maxdeg = adj[u].size();
      id = u;
    }
  }
  if (cnt < 2) {
    printf("Yes\n");
    printf("%d\n", int(leafs.size()));
    for (int i = 0; i < leafs.size(); i++) {
      printf("%d %d\n", id, leafs[i]);
    }
  } else {
    printf("No\n");
  }
  return 0;
}
