from collections import defaultdict N=int(input()) S=[] T=[] ST=defaultdict(int) for _ in range(N): s,t=input().split() S.append(s) T.append(t) ST[s]+=1 ST[t]+=1 for s,t in zip(S,T): if ST[s]>=2 and ST[t]>=2: exit(print("No")) print("Yes")