#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int d[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  if (n == 2) {
    cout << "Yes\n";
    cout << "1\n1 2\n";
    return 0;
  }
  int cnt = 0, v = 1;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    d[a]++;
    d[b]++;
    if (d[a] > d[v]) v = a;
    if (d[b] > d[v]) v = b;
    if (d[a] == 3) cnt++;
    if (d[b] == 3) cnt++;
  }
  if (cnt > 1) {
    cout << "No\n";
    return 0;
  }
  vector<int> leaves;
  for (int i = 1; i <= n; i++)
    if (d[i] == 1) leaves.push_back(i);
  cout << "Yes\n";
  cout << leaves.size() << "\n";
  for (int x : leaves) cout << v << ' ' << x << "\n";
}
