if __name__ == '__main__':
	segments = []
	for i in range(4):
		segments.append(list(map(int,input().split())))

	for i in range(4):
		x1,y1,x2,y2 = segments[i]
		# check degenerate segments
		if (x1 == x2) and (y1 == y2):
			print('NO')
			exit()
		# check whether segments parallel to any coordinate axis
		if (x1 != x2) and (y1 != y2):
			print('NO')
			exit()

	# check the number of points
	pointset = set([])
	for x1,y1,x2,y2 in segments:
		pointset.add((x1,y1))
		pointset.add((x2,y2))

	if len(pointset) == 4:
		pointlist = list(pointset)
		for i in range(4):
			ix, iy = pointlist[i]
			num_x = 0
			num_y = 0
			for j in range(4):
				if i == j:
					continue
				jx, jy = pointlist[j]
				if ix == jx:
					num_x += 1
				if iy == jy:
					num_y += 1
			if num_x != 1 and num_y != 1:
				print(num_x,num_y)
				print('NO')
				exit()
		print('YES')
	else:
		print('NO')