#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<numeric>
#include<vector>
#include<cstdio>
#include<cmath>
#include<climits>
#include<cfloat>
#include<cstring>
#define foreach(t,p,tit) for(t::iterator tit=p.begin();tit!=p.end();++tit)
#define rforeach(t,p) for(t::reverse_iterator it=p.rbegin();it!=p.rend();++it)
#define all(p) p.begin(),p.end()
#define rep(i,n) for(int i=0;i<n;i++)
double EPS = 1e-10;
double add(double a,double b){
    if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;
}


struct P{
    double x,y;
    P() {}
    P(double x,double y):x(x),y(y){
    }

    P operator +(P p){return P(x+p.x , y+p.y);}
    P operator -(P p){return P(x-p.x , y-p.y);}
    P operator *(double d){return P(x*d,y*d);}
    double dot(P p){return (x*(p.x) + y*(p.y));}
    double det(P p){return (x*p.y -y*p.x);}
    P turn(double theta){return P(x*cos(theta),y*sin(theta));}
    void output(){printf("(x,y)=%f %f\n",x,y);return ;}
};

bool on_seg(P p1,P p2, P q){
    return (fabs((p1-q).det(p2-q)) == 0 && (p1-q).dot(p2-q) <= 0);
}
P intersection(P p1,P p2,P q1,P q2)
{
    return p1 + (p2-p1)*((q2-q1).det(q1-p1)/(q2-q1).det(p2-p1));
}

using namespace std;
int main()
{
    P p1,p2,p3,p4;
    char t;
    while(cin >> p1.x>>t>>p1.y>>t>>p2.x>>t>>p2.y>>t>>p3.x>>t>>p3.y>>t>>p4.x>>t>>p4.y)
    {
        //p1.output();p2.output();p3.output();p4.output();
        P koten = intersection(p1,p3,p2,p4);
        //P koten(0.5,0.5);
        //koten.output();
        if(on_seg(p1,p3,koten)&&on_seg(p2,p4,koten)){cout << "YES"<<endl;}
        else{cout << "NO"<<endl;}


    }
    return 0;
}