n = int(input()) st = [input().split() for _ in range(n)] dic = {} for i in range(n): if st[i][0] not in dic: dic[st[i][0]] = 1 else: dic[st[i][0]] += 1 if st[i][1] not in dic: dic[st[i][1]] = 1 else: dic[st[i][1]] += 1 flag = True for s, t in st: if dic[s] == 1 or dic[t] == 1: flag = True else: flag = False break print("Yes" if flag else "No")