#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, c = 0, fl, i, a, b;
  int deg[100005] = {0};
  vector<int> v;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    deg[a]++;
    deg[b]++;
  }
  for (i = 1; i < n + 1; i++) {
    if (deg[i] > 2) {
      c++;
      fl = i;
    }
    if (deg[i] == 1) {
      v.push_back(i);
    }
  }
  if (c > 1) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  if (n == 2) {
    cout << 1 << endl;
    cout << 1 << " " << 2 << endl;
  } else {
    if (c == 0) {
      cout << 1 << endl;
      cout << v[0] << " " << v[1] << endl;
    } else {
      cout << v.size() << endl;
      for (i = 0; i < v.size(); i++) {
        cout << v[i] << " " << fl << endl;
      }
    }
  }
}
