from collections import Counter N = int(input()) Ss = [] Ts = [] C = Counter() for _ in range(N): S, T = input().split() Ss.append(S) Ts.append(T) C[S] += 1 C[T] += 1 def proc(): for i in range(N): S, T = Ss[i], Ts[i] C[S] -= 1 C[T] -= 1 if C[S] >= 1 and C[T] >= 1: return False C[S] += 1 C[T] += 1 return True ans = proc() print("Yes" if ans else "No")