#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 1;
vector<int> a[Max];
bool Not[Max];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  int count = 0, d;
  for (int i = 1; i <= n; i++)
    if (a[i].size() > 2) count++, d = i;
  if (count > 1)
    cout << "No";
  else {
    cout << "Yes\n";
    if (count == 1) {
      cout << a[d].size() << endl;
      for (int i = 1; i <= n; i++) {
        if (a[i].size() == 1) cout << d << " " << i << endl;
      }
    } else {
      cout << 1 << endl;
      for (int i = 1; i <= n; i++) {
        if (a[i].size() == 1) cout << i << " ";
      }
    }
  }
}
