#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100002;
int n, center, resn;
bool visited[MAXN];
vector<int> graph[MAXN], endpoint;
void input() {
  int u, v;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    if (i == 0) center = u;
    graph[u].push_back(v);
    graph[v].push_back(u);
    if (graph[u].size() > graph[center].size()) {
      center = u;
    }
    if (graph[v].size() > graph[center].size()) {
      center = v;
    }
  }
}
void DFS(int u) {
  visited[u] = true;
  for (int i = 0; i < graph[u].size(); ++i) {
    if (!visited[graph[u][i]]) {
      DFS(graph[u][i]);
      return;
    }
  }
  endpoint.push_back(u);
}
int main() {
  input();
  resn = graph[center].size();
  visited[center] = true;
  for (int i = 0; i < graph[center].size(); ++i) {
    DFS(graph[center][i]);
  }
  for (int i = 1; i <= n; ++i) {
    if (!visited[i]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  cout << resn << endl;
  for (int i = 0; i < endpoint.size(); ++i) {
    cout << center << " " << endpoint[i] << endl;
  }
  return 0;
}
