#include <bits/stdc++.h>
inline long long read() {
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  long long k = 1, kk = 0;
  if (c == '-') c = getchar(), k = -1;
  while (c >= '0' && c <= '9') kk = kk * 10 + c - '0', c = getchar();
  return kk * k;
}
using namespace std;
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x / 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
long long n, rd[1000010], ans, sum, z[1000010], d, x, y;
signed main() {
  n = read();
  if (n == 2) {
    puts("Yes");
    puts("1");
    puts("1 2");
    return 0;
  }
  for (long long i = 1; i < n; i++) x = read(), y = read(), rd[x]++, rd[y]++;
  for (long long i = 1; i <= n; i++) {
    if (rd[i] > 2) ans++;
    if (rd[i] == 1) z[++d] = i;
    if (rd[i] > rd[sum]) sum = i;
  }
  if (ans > 1) return puts("No"), 0;
  puts("Yes");
  writeln(d);
  for (long long i = 1; i <= d; i++) write(z[i]), putchar(' '), writeln(sum);
}
