N=int(input())
v=[0]*N; w=[0]*N
for i in range(N):
    v[i],w[i]=map(int,input().split())

print("Yes" if (1 in w) else "No")