#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> ed[N], leaves;
int n, root = -1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    ed[u].push_back(v);
    ed[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (ed[i].size() > 2) {
      if (root != -1) {
        cout << "No\n";
        return 0;
      }
      root = i;
    }
    if (ed[i].size() == 1) leaves.push_back(i);
  }
  if (root == -1)
    cout << "Yes\n"
         << "1\n"
         << leaves[0] << " " << leaves.back() << "\n";
  else {
    cout << "Yes\n";
    cout << leaves.size() << "\n";
    for (auto i : leaves) cout << root << " " << i << "\n";
  }
}
