#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int maxn = 1002;
vector<long long> adj[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long c = 0, max = 0, ones = 0, ind;
  for (int i = 1; i <= n; ++i) {
    if (adj[i].size() > 2) c++;
    if (adj[i].size() > max) {
      max = adj[i].size();
      ind = i;
    }
    if (adj[i].size() == 1) ones++;
  }
  if (c > 1) {
    cout << "No" << endl;
    return 0;
  } else if (max <= 2 && ones) {
    cout << "Yes" << endl << 1 << endl;
    for (int i = 1; i <= n; ++i) {
      if (adj[i].size() == 1) cout << i << ' ';
    }
    return 0;
  } else {
    cout << "Yes" << endl;
    long long c = 0;
    for (int i = 1; i <= n; ++i) {
      if (adj[i].size() == 1) {
        c++;
      }
    }
    cout << c << endl;
    for (int i = 1; i <= n; ++i) {
      if (adj[i].size() == 1) {
        cout << ind << ' ' << i << endl;
      }
    }
    return 0;
  }
  return 0;
}
