#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> adj;
vector<long long> vis;
vector<long long> leaf;
void dfs(long long u, long long p) {
  vis[u] = 1;
  long long deg = 0;
  for (auto i : adj[u]) {
    if (vis[i] == 0) {
      deg++;
      dfs(i, u);
    }
  }
  if (deg == 0) {
    leaf.push_back(u);
  }
}
int main() {
  long long n;
  cin >> n;
  adj.assign(n + 1, vector<long long>());
  vis.assign(n + 1, 0);
  for (int i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  long long root = 1, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() > 2) {
      cnt++;
      root = i;
    }
  }
  if (cnt > 1) {
    cout << "No";
    return 0;
  } else {
    dfs(root, -1);
    cout << "Yes\n";
    cout << leaf.size() << endl;
    for (int i = 0; i < leaf.size(); i++) {
      cout << root << " " << leaf[i];
      cout << endl;
    }
  }
}
