#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% N = int(readline()) m = map(int, read().split()) query = list(zip(m, m, m, m, m, m)) # %% eps = 1e-9 # %% def solve(x1, x2, x3, y1, y2, y3): T = [0] if y1 != y2: t = (x2 - x1) / (y1 - y2) if t > eps: T.append(t) if y1 != y3: t = (x3 - x1) / (y1 - y3) if t > eps: T.append(t) if y3 != y2: t = (x2 - x3) / (y3 - y2) if t > eps: T.append(t) T.sort() T.append(T[-1] + 1) for t1, t2 in zip(T, T[1:]): t = (t1 + t2) / 2 a1 = x1 + t * y1 a2 = x2 + t * y2 a3 = x3 + t * y3 if a1 < a2 - eps > a3 and abs(a1 - a3) > eps: return 'YES' if a1 > a2 + eps < a3 and abs(a1 - a3) > eps: return 'YES' return 'NO' # %% print('\n'.join(solve(*q) for q in query))