using System;
using System.Collections.Generic;

namespace _0012
{
    class Program
    {
        static void Main(string[] args)
        {
            var dataSet = ReadData();
            var answers = SolveProblems(dataSet);
            WriteData(answers);
        }

        /// <summary>
        /// 問題群を解く
        /// </summary>
        /// <param name="dataSet">問題毎のデータセット</param>
        /// <returns>問題毎の回答（YES or NO）</returns>
        static List<string> SolveProblems(List<TriangleAndPoint> dataSet) 
        {
            var answers = new List<string>();
            foreach(var data in dataSet)
            {
                if ((data.trianglePointA.x - data.trianglePointC.x) * (data.trianglePointA.y - data.trianglePointB.y) == (data.trianglePointA.x - data.trianglePointB.x) * (data.trianglePointA.y - data.trianglePointC.y))
                {
                    answers.Add("NO");
                }
                else
                {
                    Vector2D AB = SubtractVector2D(data.trianglePointB, data.trianglePointA);
                    Vector2D BP = SubtractVector2D(data.point, data.trianglePointB);

                    Vector2D BC = SubtractVector2D(data.trianglePointC, data.trianglePointB);
                    Vector2D CP = SubtractVector2D(data.point, data.trianglePointC);

                    Vector2D CA = SubtractVector2D(data.trianglePointA, data.trianglePointC);
                    Vector2D AP = SubtractVector2D(data.point, data.trianglePointA);

                    double crossProduct1 = AB.x * BP.y - AB.y * BP.x;
                    double crossProduct2 = BC.x * CP.y - BC.y * CP.x;
                    double crossProduct3 = CA.x * AP.y - CA.y * AP.x;

                    if ((crossProduct1 > 0 && crossProduct2 > 0 && crossProduct3 > 0) || (crossProduct1 < 0 && crossProduct2 < 0 && crossProduct3 < 0))
                    {
                        answers.Add("YES");
                    }
                    else
                    {
                        answers.Add("NO");
                    }
                }
            }
            return answers;
        }

        /// <summary>
        /// データを読み込む
        /// </summary>
        /// <returns>読み込んだ入力データセット群</returns>
        static List<TriangleAndPoint> ReadData()
        {
            var inputs = new List<TriangleAndPoint>();

            while (true)
            {
                var input = Console.ReadLine();
                if (string.IsNullOrEmpty(input))
                {
                    break;
                }

                var data = input.Split(' ');
                var dataSet = new TriangleAndPoint();
                dataSet.trianglePointA.x = double.Parse(data[0]);
                dataSet.trianglePointA.y = double.Parse(data[1]);
                dataSet.trianglePointB.x = double.Parse(data[2]);
                dataSet.trianglePointB.y = double.Parse(data[3]);
                dataSet.trianglePointC.x = double.Parse(data[4]);
                dataSet.trianglePointC.y = double.Parse(data[5]);
                dataSet.point.x = double.Parse(data[6]);
                dataSet.point.y = double.Parse(data[7]);
                inputs.Add(dataSet);
            }
            return inputs;
        }

        /// <summary>
        /// 回答をそれぞれ出力する
        /// </summary>
        /// <param name="measuredWeights">出力回答群</param>
        static void WriteData(List<string> outputs)
        {
            foreach (var output in outputs)
            {
                Console.WriteLine(output);
            }
        }

        /// <summary>
        /// 問題データセット（三角と点）
        /// </summary>
        struct TriangleAndPoint
        {
            public Vector2D trianglePointA; // A座標
            public Vector2D trianglePointB; // B座標
            public Vector2D trianglePointC; // C座標
            public Vector2D point; // 点P座標
        }

        /// <summary>
        /// 二次元座標
        /// </summary>
        struct Vector2D
        {
            public double x;
            public double y;
        }

        /// <summary>
        /// 二点のベクトル引き算をする
        /// </summary>
        /// <param name="pointB">点B</param>
        /// <param name="pointA">点A</param>
        /// <returns>二点のベクトル引き算したベクトルを返す</returns>
        static Vector2D SubtractVector2D(Vector2D pointB, Vector2D pointA)
        {
            Vector2D AB;
            AB.x = pointB.x - pointA.x;
            AB.y = pointB.y - pointA.y;
            return AB;
        }
    }
}

Measured memory_bytes: 5832