#include <bits/stdc++.h>
const int mo = 1000000007;
const int inf = 0x3f3f3f3f;
double pi = 3.14159265358979323846;
double e = 2.71828182845904523536;
using namespace std;
int main() {
  int a[100005] = {0};
  int n;
  int flag = 0;
  int cnt = 0;
  int pos;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    a[x]++;
    a[y]++;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] > 2) {
      ++cnt;
      pos = i;
    }
    if (cnt >= 2) flag = 1;
  }
  if (flag)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    if (cnt == 0) {
      cout << 1 << endl;
      for (int i = 1; i <= n; i++) {
        if (a[i] == 1 && cnt == 1) {
          cout << ' ' << i << endl;
          cnt++;
        }
        if (a[i] == 1 && cnt == 0) {
          cout << i;
          cnt++;
        }
      }
      return 0;
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 1) {
        ++ans;
      }
    }
    cout << ans << endl;
    for (int i = 1; i <= n; i++) {
      if (i != pos && a[i] == 1) {
        cout << pos << ' ' << i << endl;
      }
    }
  }
  return 0;
}
