#include <bits/stdc++.h>
using namespace std;
vector<int> b[100005];
pair<int, int> a[100005];
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    b[u].push_back(v);
    b[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    a[i] = {b[i].size(), i};
  }
  sort(a + 1, a + n + 1);
  if (a[n - 1].first > 2) {
    cout << "No" << endl;
    return 0;
  }
  int l = 1;
  while (l < n && a[l].first == 1) l++;
  cout << "Yes" << endl;
  cout << l - 1 << endl;
  for (int i = 1; i < min(l, n); i++) {
    cout << a[n].second << " " << a[i].second << endl;
  }
  return 0;
}
