#!/usr/bin/python
# -*- coding:utf-8 -*-

def main():
	numData = int(raw_input())
	count = 0
	while count < numData:
		line = raw_input()
		coords = map(float, line.strip().split())
		result = isParallel(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7])

		if result :
			print "YES"
		else:
			print "NO"

		count += 1

def isParallel(x1, y1, x2, y2, x3, y3, x4, y4):
	# 小数点以下最大５桁までの精度で計算すればよい
	x1 = int(x1 * 100000)
	y1 = int(y1 * 100000)
	x2 = int(x2 * 100000)
	y2 = int(y2 * 100000)
	x3 = int(x3 * 100000)
	y3 = int(y3 * 100000)
	x4 = int(x4 * 100000)
	y4 = int(y4 * 100000)
	# 直線ABの傾きが無限大かどうか
	if (x2 == x1):
		# 傾き無限大ならば、CDもそうなら平行
		return x4 == x3
	else:
		# 有限の傾きならば傾きが等しければOK
		return (y2 - y1)/(x2 - x1) == (y4 - y3)/(x4 - x3)

main()