from collections import defaultdict n = int(input()) st = [list(input().split()) for i in range(n)] dic = defaultdict(int) for s,t in st: dic[s] += 1 dic[t] += 1 for s,t in st: if dic[s] == 1: continue if dic[t] == 1: continue print("No") exit() print("Yes")