Hannibal is on a mission. He has to shoot a criminal. Hannibal was on the point (0, 0) and the criminal is on the point (Xc, Yc). But there is a wall between the point (X1, Y1) and (X2, Y2). 

You have to tell whether Hannibal can shoot criminal or not.

INPUT:

First line contains the total number of test cases T. For each test case, a single line contains space separated integers denoting X1, Y1, X2, Y2, Xc, Yc.

OUTPUT:

For each test case display YES, if Hannibal can shoot the criminal. Otherwise, display NO.

Constraints:

1 ≤ T ≤ 100

1 ≤ X, Y ≤ 1000000

SAMPLE INPUT
2
1 1 2 2 3 3
2 2 3 3 1 1

SAMPLE OUTPUT
NO
YES
def are_points_colinear(x1,y1,x2,y2,x3,y3):
    return x1*(y2-y3)+y1*(x3-x2)+x2*y3-x3*y2 == 0

def slope_positive(x1,y1,x2,y2):
    if x1 == x2 or y1 == y2:
        return False
    else:
        return float(x2-x1)/float(y2-y1) > 0
def slope_negative(x1,y1,x2,y2):
    if x1 == x2 or y1 == y2:
        return False
    else:
        return float(x2-x1)/float(y2-y1) > 0

def are_points_on_same_side(line,x1,y1,x2,y2):
    k1 = line[0]*x1 + line[1]*y1 + line[2]
    k2 = line[0]*x2 + line[1]*y2 + line[2]

    if k1*k2 < 0:
        return False
    else:
        return True

def get_distance(x,y):
    return x*x+y*y

for test_cases in range(input()):
    s = map(int,raw_input().split())
    wall_edge1_x = s[0]
    wall_edge1_y = s[1]

    wall_edge2_x = s[2]
    wall_edge2_y = s[3]

    target_x = s[4]
    target_y = s[5]

    line1 = [0]*3
    line2 = [0]*3

    line1[0] = -(wall_edge2_y - wall_edge1_y)
    line1[1] = (wall_edge2_x - wall_edge1_x)
    line1[2] = wall_edge1_x*(wall_edge2_y - wall_edge1_y) - wall_edge1_y*(wall_edge2_x - wall_edge1_x)

    line2[1] = target_x
    line2[0] = -target_y
    line2[2] = 0


    if are_points_colinear(wall_edge1_x,wall_edge1_y,wall_edge2_x,wall_edge2_y,target_x,target_y) and are_points_colinear(wall_edge1_x,wall_edge1_y,wall_edge2_x,wall_edge2_y,0,0):
        if get_distance(target_x,target_y) < min(get_distance(wall_edge1_x,wall_edge1_y),get_distance(wall_edge2_x,wall_edge2_y)) :
            print 'YES'
        else:
            print 'NO'
    else:
        if are_points_on_same_side(line1,target_x,target_y,0,0):
            print 'YES'
        else:
            if are_points_on_same_side(line2,wall_edge1_x,wall_edge1_y,wall_edge2_x,wall_edge2_y):
                print 'YES'
            else:
                print 'NO'