using System;
class Vector2
{
    private double x, y;
    public Vector2() { x = 0.0; y = 0.0; }
    public Vector2(double i, double j) { x = i; y = j; }
    public static Vector2 operator +(Vector2 op1, Vector2 op2)
    {
        Vector2 result = new Vector2();
        result.x = op1.x + op2.x;
        result.y = op1.y + op2.y;
        return result;
    }
    public static Vector2 operator -(Vector2 op1, Vector2 op2)
    {
        Vector2 result = new Vector2();
        result.x = op1.x - op2.x;
        result.y = op1.y - op2.y;
        return result;
    }
    public double X { get { return x; } }
    public double Y { get { return y; } }
}
class _0035
{
    public static void Main()
    {
        string str;
        string[] data;
        double det, a, b, c, d, e, f, xC, t;
        Vector2 A, B, C, D, AC, BD;
        while ((str = Console.ReadLine()) != null)
        {
            data = str.Split(',');
            A = new Vector2(double.Parse(data[0]), double.Parse(data[1]));
            B = new Vector2(double.Parse(data[2]), double.Parse(data[3]));
            C = new Vector2(double.Parse(data[4]), double.Parse(data[5]));
            D = new Vector2(double.Parse(data[6]), double.Parse(data[7]));
            AC = C - A; BD = D - B;
            a = AC.X; b = -AC.Y; c = -1 * (A.X - A.Y) * AC.X;
            d = BD.X; e = -BD.Y; f = -1 * (B.X - B.Y) * BD.X;
            det = a * e - b * d;
            xC = (e * c - b * f) / det;
            t = -1 * (xC - A.X) / AC.X;
            Console.WriteLine((t >= 0.0 && t <= 1.0) ? "YES" : "NO");
        }
    }
}