#include <bits/stdc++.h>
using namespace std;
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long mul(long long a, long long b) {
  long long c;
  c = (a % 1000000007 * b % 1000000007) % 1000000007;
  return c;
}
long long add(long long a, long long b) {
  long long c;
  c = (a % 1000000007 + b % 1000000007) % 1000000007;
  return c;
}
long long sub(long long a, long long b) {
  long long c;
  c = ((a % 1000000007 - b % 1000000007) % 1000000007 + 1000000007) %
      1000000007;
  return c;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long exgcd(long long x, long long y, long long &a, long long &b) {
  int flag = 0;
  long long t, la = 1, lb = 0, ra = 0, rb = 1;
  while (x % y) {
    if (flag == 0)
      la -= x / y * ra, lb -= x / y * rb;
    else
      ra -= x / y * la, rb -= x / y * lb;
    t = x, x = y, y = t % y;
    flag = 1 - flag;
  }
  if (flag == 0)
    a = ra, b = rb;
  else
    a = la, b = lb;
  return y;
}
long long n;
vector<long long> graph[100005];
long long in[100005];
vector<long long> one;
int main() {
  scanf("%lld", &n);
  long long cnt = 0;
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    scanf("%lld", &u);
    scanf("%lld", &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
    in[v]++;
    in[u]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (in[i] == 1) cnt++;
  }
  if (cnt == 2) {
    cout << "Yes" << endl;
    cout << 1 << endl;
    for (long long i = 1; i <= n; i++) {
      if (in[i] == 1) {
        cout << i << " ";
      }
    }
    return 0;
  } else {
    long long ans;
    cnt = 0;
    long long cnt2 = 0;
    for (long long i = 1; i <= n; i++) {
      if (in[i] > 2) {
        ans = i;
        cnt++;
      }
      if (in[i] == 1) {
        cnt2++;
      }
    }
    if (cnt == 1) {
      cout << "Yes" << endl;
      cout << cnt2 << endl;
      for (long long i = 1; i <= n; i++) {
        if (in[i] == 1) {
          cout << ans << " " << i << endl;
        }
      }
      return 0;
    }
    cout << "No" << endl;
  }
  return 0;
}
