using System; using System.Collections.Generic; using static System.Console; using System.Linq; class yuki308 { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NList).ToArray(); static void Main() { var n = NN; var map = NMap(n); for (var i = 0; i < n; ++i) { --map[i][0]; --map[i][1]; Array.Sort(map[i]); } var p = new Pair[n]; for (var i = 0; i < p.Length; ++i) p[i] = new Pair(i); for (var i = 0; i < map.Length; ++i) { p[map[i][0]].Edges.Add(i); p[map[i][1]].Edges.Add(i); } var used = new bool[n]; var res = new int[n]; for (var i = 0; i < p.Length; ++i) { var cur = i; while (p[cur].Edges.Count == 1) { var paint = p[cur].Edges[0]; res[paint] = cur + 1; used[cur] = true; p[map[paint][0]].Edges.Remove(paint); p[map[paint][1]].Edges.Remove(paint); cur = cur ^ (map[paint][0]) ^ (map[paint][1]); } } for (var i = 0; i < p.Length; ++i) { var cur = i; while (p[cur].Edges.Count > 0) { var paint = p[cur].Edges[0]; res[paint] = cur + 1; used[cur] = true; p[map[paint][0]].Edges.Remove(paint); p[map[paint][1]].Edges.Remove(paint); cur = cur ^ (map[paint][0]) ^ (map[paint][1]); } } if (used.Count(f => !f) == 0) { WriteLine("Yes"); WriteLine(string.Join("\n", res)); } else WriteLine("No"); } class Pair { public List Edges = new List(); public int Num; public Pair(int num) { Num = num; } } class UnionFindTree { int[] roots; public UnionFindTree(int size) { roots = new int[size]; for (var i = 0; i < size; ++i) roots[i] = -1; } public int GetRoot(int a) { if (roots[a] < 0) return a; return roots[a] = GetRoot(roots[a]); } public bool IsSameTree(int a, int b) { return GetRoot(a) == GetRoot(b); } public bool Unite(int a, int b) { var x = GetRoot(a); var y = GetRoot(b); if (x == y) return false; if (-roots[x] < -roots[y]) { var tmp = x; x = y; y = tmp; } roots[x] += roots[y]; roots[y] = x; return true; } public int GetSize(int a) { return -roots[GetRoot(a)]; } } }