from collections import Counter n = int(input()) st = [input().split() for _ in range(n)] c = Counter() for s, t in st: c[s] += 1 c[t] += 1 print('Yes' if all(c[s] == 1 or c[t] == 1 for s, t in st) else 'No')