#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
long long q, w;
vector<int> vec;
long long tmp1, tmp2;
long long t[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> tmp1 >> tmp2;
    t[tmp1]++;
    t[tmp2]++;
  }
  for (int i = 1; i <= n; i++) {
    if (t[i] == 1) {
      vec.push_back(i);
    }
    if (t[i] > 2) {
      q++;
      w = i;
    }
  }
  if (q > 1) {
    cout << "No";
  } else {
    cout << "Yes" << endl;
    if (vec.size() == 2) {
      cout << 1 << endl;
      cout << vec[0] << " " << vec[1];
      return 0;
    }
    cout << vec.size() << endl;
    for (auto u : vec) {
      cout << w << " " << u << endl;
    }
  }
  return 0;
}
