#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a, b, k, root, leav[100005], c = 0;
  vector<int> v[100005];
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    v[a - 1].push_back(b - 1);
    v[b - 1].push_back(a - 1);
  }
  k = 0;
  root = -1;
  for (i = 0; i < n; i++) {
    if (v[i].size() > 2) {
      root = i;
      c++;
    } else if (v[i].size() == 1)
      leav[k++] = i;
  }
  if (c > 1)
    cout << "No";
  else {
    cout << "Yes\n";
    if (root == -1) {
      cout << 1 << "\n" << leav[0] + 1 << " " << leav[1] + 1;
    } else {
      cout << k << "\n";
      for (i = 0; i < k; i++) cout << root + 1 << " " << leav[i] + 1 << "\n";
    }
  }
}
