{
Written by Fyodor Menshikov 03.02.2005
14:28-14:39
}
const
   maxN=1000;
var
   edge:array[1..maxN-1,1..2]of integer;
   parent:array[1..maxN]of integer;
   inTree:array[1..maxN]of boolean;
   n:integer;

   procedure CreateTree(node:integer);
   var
      i:integer;
   begin
      for i:=1 to n-1 do begin
         if (edge[i,1]=node) and not inTree[edge[i,2]] then begin
            inTree[edge[i,2]]:=true;
            parent[edge[i,2]]:=node;
            CreateTree(edge[i,2]);
         end;
         if (edge[i,2]=node) and not inTree[edge[i,1]] then begin
            inTree[edge[i,1]]:=true;
            parent[edge[i,1]]:=node;
            CreateTree(edge[i,1]);
         end;
      end;
   end;

   procedure go(node:integer;paintFirst:boolean);
   var
      i:integer;
   begin
      if paintFirst then
         write(node,' ');
      for i:=1 to n do
         if parent[i]=node then
            go(i,not paintFirst);
      if not paintFirst then
         write(node,' ');
   end;

var
   i:integer;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   readln(n);
   for i:=1 to n-1 do
      readln(edge[i,1],edge[i,2]);
   for i:=1 to n do
      inTree[i]:=false;
   inTree[1]:=true;
   CreateTree(1);
   writeln('YES');
   go(1,true);
   writeln(1);
end.