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.trianglePoint1.x - data.trianglePoint3.x) * (data.trianglePoint1.y - data.trianglePoint2.y) == (data.trianglePoint1.x - data.trianglePoint2.x) * (data.trianglePoint1.y - data.trianglePoint3.y))
                {
                    answers.Add("NO");
                }
                else
                {
                    Vector2D AB = sub_vector(data.trianglePoint2, data.trianglePoint1);
                    Vector2D BP = sub_vector(data.point, data.trianglePoint2);

                    Vector2D BC = sub_vector(data.trianglePoint3, data.trianglePoint2);
                    Vector2D CP = sub_vector(data.point, data.trianglePoint3);

                    Vector2D CA = sub_vector(data.trianglePoint1, data.trianglePoint3);
                    Vector2D AP = sub_vector(data.point, data.trianglePoint1);

                    //外積計算
                    double c1 = AB.x * BP.y - AB.y * BP.x;
                    double c2 = BC.x * CP.y - BC.y * CP.x;
                    double c3 = CA.x * AP.y - CA.y * AP.x;

                    if ((c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0))
                    {
                        answers.Add("YES");
                    }
                    else
                    {
                        answers.Add("NO");
                    }
                }

            }
            return answers;
        }

        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.trianglePoint1.x = double.Parse(data[0]);
                dataSet.trianglePoint1.y = double.Parse(data[1]);
                dataSet.trianglePoint2.x = double.Parse(data[2]);
                dataSet.trianglePoint2.y = double.Parse(data[3]);
                dataSet.trianglePoint3.x = double.Parse(data[4]);
                dataSet.trianglePoint3.y = double.Parse(data[5]);
                dataSet.point.x = double.Parse(data[6]);
                dataSet.point.y = double.Parse(data[7]);
                inputs.Add(dataSet);
            }
            return inputs;
        }

        static void WriteData(List<string> outputs)
        {
            foreach (var output in outputs)
            {
                Console.WriteLine(output);
            }
        }

        struct TriangleAndPoint
        {
            public Vector2D trianglePoint1; // 第1座標
            public Vector2D trianglePoint2; // 第2座標
            public Vector2D trianglePoint3; // 第3座標
            public Vector2D point; // 点P座標
        }

        struct Vector2D
        {
            public double x;
            public double y;
        }

        static Vector2D sub_vector(Vector2D a, Vector2D b)
        {
            Vector2D ret;
            ret.x = a.x - b.x;
            ret.y = a.y - b.y;
            return ret;
        }
    }
}

Measured memory_bytes: 5832