• + 0 comments
    import math
    import os
    import random
    import re
    import sys
    
    def line(arr_x,arr_y):
        if len(set(arr_x)) == 1:
            return "YES"
        elif len(set(arr_y)) == 1:
            return "YES"
        else:
            return "NO"
        
    if __name__ == '__main__':
        n = int(input())
        arr_x = []
        arr_y = []
        for n_itr in range(n):
            xy = input().split()
            x = int(xy[0])
            y = int(xy[1])
            arr_x.append(x)
            arr_y.append(y)
        print(line(arr_x,arr_y))