using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _0035
{
    class Program
    {
        static double[] _triangleAndPoint = new double[8];
        static void Main(string[] args)
        {
            string fourPoints = "";
            while ((fourPoints = Console.ReadLine()) != null)
            {
                _triangleAndPoint = fourPoints.Split(',').Select(double.Parse).ToArray();
                double[] triangleA = new double[6] { _triangleAndPoint[0], _triangleAndPoint[1], _triangleAndPoint[2], _triangleAndPoint[3], _triangleAndPoint[4], _triangleAndPoint[5] };
                double[] triangleB = new double[6] { _triangleAndPoint[2], _triangleAndPoint[3], _triangleAndPoint[4], _triangleAndPoint[5], _triangleAndPoint[6], _triangleAndPoint[7] };
                double[] triangleC = new double[6] { _triangleAndPoint[4], _triangleAndPoint[5], _triangleAndPoint[6], _triangleAndPoint[7], _triangleAndPoint[0], _triangleAndPoint[1] };
                double[] triangleD = new double[6] { _triangleAndPoint[6], _triangleAndPoint[7], _triangleAndPoint[0], _triangleAndPoint[1], _triangleAndPoint[2], _triangleAndPoint[3] };
                double[] pointA = new double[2] { _triangleAndPoint[6], _triangleAndPoint[7] };
                double[] pointB = new double[2] { _triangleAndPoint[0], _triangleAndPoint[1] };
                double[] pointC = new double[2] { _triangleAndPoint[2], _triangleAndPoint[3] };
                double[] pointD = new double[2] { _triangleAndPoint[4], _triangleAndPoint[5] };
                if (!Triangle.IsInsideOfArea(triangleA, pointA) && !Triangle.IsInsideOfArea(triangleB, pointB) && !Triangle.IsInsideOfArea(triangleC, pointC) && !Triangle.IsInsideOfArea(triangleD, pointD))
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
        }
    }
    class Triangle
    {
        internal static bool IsInsideOfArea(double[] triangle, double[] point)
        {
            double[] pointA = new double[2] { triangle[0], triangle[1] };
            double[] pointB = new double[2] { triangle[2], triangle[3] };
            double[] pointC = new double[2] { triangle[4], triangle[5] };
            if (ValuateForeignProduct(pointA, pointB, pointC) > 0)
            {
                if ((ValuateForeignProduct(point, pointA, pointB) > 0)
                    && (ValuateForeignProduct(point, pointB, pointC) > 0)
                    && (ValuateForeignProduct(point, pointC, pointA) > 0))
                    return true;
            }
            else if (ValuateForeignProduct(pointA, pointB, pointC) < 0)
            {
                if ((ValuateForeignProduct(point, pointA, pointB) < 0)
                    && (ValuateForeignProduct(point, pointB, pointC) < 0)
                    && (ValuateForeignProduct(point, pointC, pointA) < 0))
                    return true;
            }
            return false;

        }
        internal static double ValuateForeignProduct(double[] pointA, double[] pointB, double[] pointC)
        {
            double x1 = pointA[0];
            double y1 = pointA[1];
            double x2 = pointB[0];
            double y2 = pointB[1];
            double x3 = pointC[0];
            double y3 = pointC[1];
            double ForeignProduct = ((x2 - x1) * (y3 - y2)) - ((x3 - x2) * (y2 - y1));
            return ForeignProduct;
        }
    }
}




Measured memory_bytes: 18432