from collections import Counter N = int(input()) W_list = [] S_list = [] T_list = [] for _ in range(N): S, T = input().split() W_list.append(S) W_list.append(T) S_list.append(S) T_list.append(T) W_cnt = Counter(W_list) for i in range(N): S = S_list[i] T = T_list[i] if W_cnt[S] == 1 or W_cnt[T] == 1: continue else: print("No") exit() print("Yes")