#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> deg(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    deg[u]++;
    deg[v]++;
  }
  int c = -1, count_c = 0;
  vector<int> leaf;
  for (int i = 0; i < n; i++) {
    if (deg[i] == 1) {
      leaf.push_back(i);
      continue;
    }
    if (deg[i] > 2) {
      count_c++;
      c = i;
    }
  }
  if (count_c > 1) {
    cout << "No";
    return 0;
  } else {
    cout << "Yes\n";
    if (c != -1) {
      cout << leaf.size() << '\n';
      for (int i = 0; i < leaf.size(); i++) {
        cout << leaf[i] + 1 << ' ' << c + 1 << '\n';
      }
    } else {
      assert(leaf.size() == 2);
      cout << 1 << '\n';
      cout << leaf[0] + 1 << ' ' << leaf[1] + 1 << '\n';
    }
  }
  return 0;
}
