#include <bits/stdc++.h>
using namespace std;
int flag, visit[100009];
vector<int> v[100009];
vector<int> ans;
int main() {
  int n, a, b, i;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (n == 2) {
    cout << "Yes\n";
    cout << "1\n";
    cout << "1 2";
    return 0;
  }
  int ma = 0, index = 0;
  for (i = 1; i <= n; i++) {
    if (ma < v[i].size()) {
      ma = v[i].size();
      index = i;
    }
  }
  for (i = 1; i <= n; i++) {
    if (i != index && v[i].size() > 2) {
      cout << "No";
      return 0;
    }
    if (v[i].size() == 1) ans.push_back(i);
  }
  cout << "Yes\n" << ans.size() << "\n";
  for (i = 0; i < ans.size(); i++) {
    cout << index << " " << ans[i] << "\n";
  }
}
