#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int INF = (int)(1e9 + 1e6);
const long long LINF = (long long)(4e18);
const double EPS = 1e-14;
mt19937 ggen;
void solve();
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(0);
  ggen = mt19937(1337);
  solve();
}
void dfs(int s);
int n;
vector<vector<int> > g;
int num, ktnum = 0;
vector<bool> used;
vector<int> an;
bool flag = true;
void solve() {
  cin >> n;
  g.resize(n);
  used.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int v1, v2;
    cin >> v1 >> v2;
    v1--;
    v2--;
    g[v1].push_back(v2);
    g[v2].push_back(v1);
  }
  for (int i = 0; i < n; ++i) {
    if (g[i].size() > ktnum) {
      num = i;
      ktnum = g[i].size();
    }
  }
  dfs(num);
  if (!flag) {
    cout << "No";
    return;
  }
  cout << "Yes" << endl;
  cout << (int)(an).size() << endl;
  for (int i = 0; i < (int)(an).size(); ++i) {
    cout << num + 1 << " " << an[i] + 1 << endl;
  }
}
void dfs(int s) {
  used[s] = true;
  if (s != num) {
    if ((int)(g[s]).size() > 2) {
      flag = false;
    }
  }
  for (auto i = g[s].begin(); i != g[s].end(); ++i) {
    if (!used[*i]) {
      dfs(*i);
    }
  }
  if ((int)(g[s]).size() == 1 && s != num) {
    an.push_back(s);
  }
}
