from heapq import heapify, heappop, heappush from collections import defaultdict from collections import deque def main(): N = int(input()) deg = [0]*N dic = defaultdict(list) for i in range(N): a,b = map(int,input().split()) a -= 1; b -= 1 deg[a] += 1 deg[b] += 1 dic[a].append((b,i)) #行先、辺の番号 dic[b].append((a,i)) PQ = [] for i in range(N): heappush(PQ,(deg[i],i)) Q = deque([]) #for i in range(N): # heappush(PQ,(deg[i],i)) ret = [] used_point = set([]) used_edge = set([]) while PQ: d,i = heappop(PQ) if i in used_point: continue Q.append(i) while Q: v = Q.popleft() #print("v",v) if v in used_point: continue for u,edge_idx in dic[v]: #print(u,edge_idx,used_edge) if edge_idx in used_edge: continue ret.append(v) used_point.add(v) used_edge.add(edge_idx) if u not in used_point: Q.append(u) break #print(ret) if len(ret) == N: print('Yes') ret = [x+1 for x in ret] print(*ret,sep="\n") else: print('No') if __name__ == '__main__': main()