• + 0 comments
    x = []
    y = []
    n = int(input())
    for i in range(n):
        xy = input().split()
        x.append(xy[0])
        y.append(xy[1])
    print ("YES" if (len(set(x)) == 1 or len(set(y)) == 1 ) else "NO")