#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > gr;
vector<int> ans;
int node = -1, node2;
void dfs(int v, int p) {
  if (gr[v].size() == 1 && v != node) {
    ans.push_back(v);
    return;
  }
  for (auto i : gr[v]) {
    if (i != p) {
      dfs(i, v);
    }
  }
}
int main() {
  int n;
  cin >> n;
  gr.resize(n + 1);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  int x = 1;
  node2 = 1;
  for (int i = 1; i <= n; ++i) {
    if (gr[i].size() > 2) {
      if (node == -1)
        node = i;
      else
        x = 0;
    }
  }
  if (!x) {
    cout << "No";
  } else {
    if (node == -1) node = 1;
    cout << "Yes" << endl;
    dfs(node, -1);
    cout << ans.size() << endl;
    for (auto i : ans) cout << node << " " << i << endl;
  }
}
