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