X = [[2, 8], [3, 9], [7, 9]] N = int(input()) for i in range(N): x1, y1, x2, y2 = map(int, input().split()) if [x1, y1] in X: X[X.index([x1, y1])] = [x2, y2] if X == [[5, 8], [4, 8], [6, 8]]: print('YES') else: print('NO')