#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<int>> t(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    t[a].push_back(b);
    t[b].push_back(a);
  }
  int num = 0, idx = -1;
  for (int i = 0; i < n; i++) {
    if (t[i].size() > 2) {
      num++;
      idx = i;
    }
  }
  if (num > 1)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    if (num == 0) {
      cout << 1 << endl;
      vector<int> v;
      for (int i = 0; i < n; i++)
        if (t[i].size() == 1) v.push_back(i);
      cout << v[0] + 1 << " " << v[1] + 1 << endl;
    } else {
      cout << t[idx].size() << endl;
      vector<int> v;
      for (int i = 0; i < n; i++)
        if (t[i].size() == 1) v.push_back(i);
      for (int i = 0; i < (int)t[idx].size(); i++) {
        cout << idx + 1 << " " << v[i] + 1 << endl;
      }
    }
  }
}
