#include <bits/stdc++.h>
using namespace std;
int a[100005], ans[100005];
int main() {
  int n, a1, a2, num = 0, gg = 0, t = 0;
  cin >> n;
  bool ty = true, zz = true;
  for (int i = 1; i <= n - 1; ++i) {
    cin >> a1 >> a2;
    a[a1]++;
    a[a2]++;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] > 2) {
      num++;
      gg = i;
    }
    if (num > 1) {
      ty = false;
      break;
    } else if (a[i] == 1) {
      ans[i] = i;
      t++;
    }
  }
  if (!ty) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    if (num == 1) {
      cout << t << endl;
      for (int i = 1; i <= n; ++i) {
        if (ans[i] != 0) {
          cout << gg << " " << ans[i] << endl;
        }
      }
    } else {
      cout << 1 << endl;
      for (int i = 1; i <= n; ++i) {
        if (ans[i] != 0 && zz) {
          cout << ans[i] << " ";
          zz = false;
        } else if (ans[i] != 0 && !zz) {
          cout << ans[i] << endl;
        }
      }
    }
  }
  return 0;
}
