# No.870 無敵囲い positions = [[2, 8], [3 ,9], [7, 9]] targets = [[5, 8], [4, 8], [6, 8]] n = int(input()) for i in range(n): x1, y1, x2, y2 = [int(i) for i in input().split()] for m in positions: if m == [x1, y1]: positions[positions.index(m)] = [x2, y2] print('YES' if positions == targets else 'NO')