#include <bits/stdc++.h>
using namespace std;
int n, cnt, out[100010], tot, ans[100010], d;
int main() {
  int x, y;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    out[x]++;
    out[y]++;
  }
  for (int i = 1; i <= n; i++)
    if (out[i] > 2) {
      cnt++;
      d = i;
    } else if (out[i] == 1) {
      tot++;
      ans[tot] = i;
    }
  if (cnt > 1)
    puts("No");
  else {
    puts("Yes");
    if (d) {
      cout << tot << endl;
      for (int i = 1; i <= tot; i++) cout << d << " " << ans[i] << endl;
    } else {
      cout << 1 << endl;
      cout << ans[1] << " " << ans[2] << endl;
    }
  }
  return 0;
}
