N = int(input())
vw = [tuple(map(int, input().split())) for _ in range(N)]
if 1 in [w for v, w in vw]:
    print("Yes")
else:
    print("No")