#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, dg[N];
vector<int> adj[N];
vector<pair<int, int>> ans;
bool visit[N];
bool go(int now) {
  if (visit[now]) return true;
  visit[now] = true;
  if (dg[now] > 2) return false;
  if (dg[now] == 1) {
    ans.back().second = now;
    return true;
  }
  for (int child : adj[now]) {
    bool check = go(child);
    if (check == false) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cout.setf(ios::fixed), cout.precision(12);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v), adj[v].push_back(u);
    ++dg[u], ++dg[v];
  }
  int root = -1, max_degree = -1;
  for (int i = 1; i <= n; ++i)
    if (dg[i] > max_degree) {
      max_degree = dg[i];
      root = i;
    }
  visit[root] = true;
  for (int child : adj[root]) {
    ans.emplace_back(root, -1);
    if (!go(child)) {
      cout << "No" << '\n';
      return 0;
    }
  }
  cout << "Yes" << '\n';
  cout << ans.size() << '\n';
  for (auto& p : ans) cout << p.first << ' ' << p.second << '\n';
}
