n = int(input()) abc = [[2, 8], [3, 9], [7, 9]] mtk = [[5, 8], [4, 8], [6, 8]] for _ in range(n): x1, y1, x2, y2 = map(int, input().split()) for j in range(3): if abc[j][0] == x1 and abc[j][1] == y1: abc[j][0], abc[j][1] = x2, y2 print('YES' if abc == mtk else 'NO')