import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip, std.datetime;

void main() {
    auto N = readln.chomp.to!int;
    auto G = new int[][](N);
    foreach (_; 0..N-1) {
        auto s = readln.split.map!(to!int);
        G[s[0]-1] ~= s[1]-1;
        G[s[1]-1] ~= s[0]-1;
    }

    if (G.map!(g => g.length >= 3).sum >= 2) {
        writeln("No");
        return;
    }

    writeln("Yes");

    int[] root1;
    int root3 = -1;
    foreach (i; 0..N) if (G[i].length == 1) root1 ~= i;
    foreach (i; 0..N) if (G[i].length >= 3) root3 = i;

    if (root3 == -1) {
        writeln(1);
        writeln(root1[0]+1, " ", root1[1]+1);
    } else {
        writeln(root1.length);
        foreach (r; root1)
            writeln(r+1, " ", root3+1);
    }
}
