N=int(input()) T={} for i in range(N): x,y=map(int,input().split()) if not x in T: T[x]=y else: if y!=T[x]: print('No') exit() print('Yes')