#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n;
  cin >> n;
  int d[n + 1];
  for (int i = 1; i <= n; i++) d[i] = 0;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v, d[u]++, d[v]++;
  }
  int k = 0;
  bool f = true;
  for (int i = 1; i <= n; i++)
    if (d[i] >= 3) {
      if (k) {
        f = false;
        break;
      } else
        k = i;
    }
  if (!f)
    cout << "No\n";
  else {
    if (!k) k = 1;
    cout << "Yes\n";
    vector<int> l;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1 && i != k) l.push_back(i);
    cout << l.size() << "\n";
    for (int i : l) cout << k << " " << i << "\n";
  }
}
