#include<iostream>
#include<string>
using namespace std;

struct tPoint{
	double x, y;
};

double f( double x, tPoint &a, tPoint &b ){
	return (b.y-a.y)*(x-a.x)/(b.x-a.x) + a.y;
}

int main(){
	tPoint a, b, c, d;
	string in;
	while( getline( cin, in ), in.length() ){
		sscanf( in.c_str(), "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y );
		bool isCrossAC, isCrossBD;
		if( b.x == d.x ){
			isCrossBD = ((a.x>b.x&&c.x<b.x)||(a.x<b.x&&c.x>b.x));
		}else{
			double fa = f( a.x, b, d );
			double fc = f( c.x, b, d );
			isCrossBD = ((a.y>fa&&c.y<fc)||(a.y<fa&&c.y>fc));
		}
		if( a.x == c.x ){
			isCrossAC = ((b.x>a.x&&d.x<a.x)||(b.x<a.x&&d.x>a.x));
		}else{
			double fb = f( b.x, a, c );
			double fd = f( d.x, a, c );
			isCrossAC = ( ((b.y>fb&&d.y<fd)||(b.y<fb&&d.y>fd)) );
		}
		if( isCrossAC && isCrossBD )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}