#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long llinf = (1LL << 61);
const int inf = (1 << 30);
const int nmax = 1e5 + 50;
const int mod = 1e9 + 7;
using namespace std;
int n, i, x, y, nod = 1, nr;
vector<int> a[nmax];
vector<pair<int, int> > ans;
void dfs(int x, int p) {
  for (int i = 0; i < a[x].size(); i++)
    if (a[x][i] != p) dfs(a[x][i], x);
  if (a[x].size() == 1 && x != nod) ans.push_back({nod, x});
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  for (i = 1; i <= n; i++)
    if ((int)a[i].size() > 2) nr++, nod = i;
  if (nr > 1) return cout << "No" << endl, 0;
  dfs(nod, 0);
  cout << "Yes" << endl << (int)ans.size() << endl;
  for (i = 0; i < (int)ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
