#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
vector<long long> adj[N], v;
bool vis[N];
long long ok = 1, mk = 0, root = 0;
void dfs(long long nd) {
  vis[nd] = 1;
  long long cnt = 0, flag = 0;
  for (auto u : adj[nd]) {
    if (!vis[u]) {
      if (nd != root) cnt++;
      dfs(u);
    }
  }
  if (nd != root && cnt >= 2)
    ok = 0;
  else if (nd != root && cnt == 0)
    v.push_back(nd);
}
signed main() {
  long long n, maxx = -1;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) {
    if (maxx < adj[i].size()) {
      maxx = adj[i].size();
      root = i;
    }
  }
  dfs(root);
  if (!ok)
    cout << "No\n";
  else {
    cout << "Yes\n" << v.size() << "\n";
    for (auto u : v) {
      cout << root << " " << u << endl;
    }
  }
  return 0;
}
