from heapq import heapify, heappop, heappush from collections import defaultdict 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)) ret = [] used_point = set([]) used_edge = set([]) for i in range(N): if i in used_point: continue heappush(PQ,(deg[i],i)) while PQ: #print(PQ) d,v = heappop(PQ) #print(d,v) for u,edge_idx in dic[v]: if v in used_point and u in used_point: continue if edge_idx in used_edge: continue if v in used_point: ret.append(u) used_point.add(u) used_edge.add(edge_idx) deg[v] -= 1 deg[u] -= 1 elif u in used_point: ret.append(v) used_point.add(v) used_edge.add(edge_idx) deg[v] -= 1 deg[u] -= 1 else: ret.append(v) deg[v] -= 1 deg[u] -= 1 used_point.add(v) used_edge.add(edge_idx) #print("push",u,edge_idx) heappush(PQ,(deg[u],u)) if len(ret) == N: print('Yes') ret = [x+1 for x in ret] print(*ret,sep="\n") else: print('No') if __name__ == '__main__': main()