#include <bits/stdc++.h>
using namespace std;
vector<int> adj[123456], v;
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  if (n == 2) {
    cout << "Yes\n1\n1 2\n";
    return;
  }
  int c = 0, mx = 0, mx1 = 0;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) {
      v.push_back(i);
      c++;
    }
    if (mx < adj[i].size()) {
      mx = adj[i].size();
      mx1 = i;
    }
  }
  if (mx != c) {
    cout << "No";
  } else {
    cout << "Yes\n" << v.size() << "\n";
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " " << mx1 << "\n";
    }
  }
}
int main() {
  solve();
  return 0;
}
