Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func check(x, y, x1, y1, x2, y2 float64) float64 {
	return (x2-x1)*y - (y2-y1)*x + x1*y2 - x2*y1
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 8)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 8; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		if check(a[0], a[1], a[2],a[3], a[6], a[7])*check(a[4], a[5], a[2], a[3], a[6], a[7]) < 0 && check(a[6], a[7], a[0], a[1], a[4], a[5])*check(a[2],a[3], a[0], a[1], a[4], a[5]) < 0 {
			fmt.Println("YES")	
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <cstdio>
#include <utility>
#include <vector>
#include <complex>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
bool scan(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
#undef vo

typedef complex<double> P;

double cross(P a, P b) {
    return a.real() * b.imag() - a.imag() * b.real();
}

bool convex(vector<P> &v) {
	vector<bool> res(4);
	for (int i = 0; i < 4; i++)
		res[i] = cross(v[i] - v[(i + 1) % 4], v[(i + 1) % 4] - v[(i + 2) % 4]) <= 0;
	for (int i = 0; i < 3; i++)
		if (res[i] != res[i + 1])
			return false;
	return true;
}

int main() {
	int i = 0;
	vector<P> vp(4);
	for (double x, y; scanf("%lf,%lf,", &x, &y) != EOF;) {
		vp[i++] = P(x, y);
		if (i == 4){
			out(convex(vp) ? "YES" : "NO", '\n');
			i = 0;
		}
	}
}

C++: #include<iostream>
#include<cmath>

using namespace std;

#define EPS 1e-5

struct point{
	double x;
	double y;
};

struct line{
	double a; // 傾き
	double b; // y切片
};

istream& operator >> ( istream& s , point& p );
bool get_line( const point& a , const point& b , line *a_b );
bool get_position( const point& a , const point& b , const point& c );
bool get_cross( const point& a , const point& b , const point& c , const point& d );
bool get_convex( const point& a , const point& b , const point& c , const point& d );
bool get_convex_new( const point& a , const point& b , const point& c , const point& d );

int main(void)
{
	point a, b, c, d;

	while(1)
	{
		cin >> a >> b >> c >> d;
		if( cin.eof() ) break;
		if( get_convex_new( a , b , c , d ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

istream& operator >> ( istream& s , point& p )
{
	return s >> p.x >> p.y;
}

bool get_line( const point& a , const point& b , line *a_b )
{
	if( fabs(a.x - b.x) < EPS ) return false;
	else{
		a_b->a = (a.y - b.y)/(a.x - b.x);
		a_b->b = a.y - (a.x * a_b->a);
		return true;
	}
}

bool get_position( const point& a , const point& b , const point& c )
{
	// 点a, bを通る直線に対する点cの位置を返す。(右、上：ture)

	line a_b;

	bool result = get_line( a , b , &a_b );
	if( result == false ){
		if( c.x > a.x ) return true;
		else return false;
	}
	else{
		if( c.y > a_b.a * c.x + a_b.b ) return true;
		else return false;
	}
}

bool get_cross( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, cを結ぶ線分と、点b, dを通る直線とが交わればtrueを返す。

	bool result_ac_b = get_position( a , c , b );
	bool result_ac_d = get_position( a , c , d );
	if( result_ac_b == result_ac_d ) return false;
	else return true;
}

bool get_convex( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, b, c, dの順に結んだ時にできる四角形が凸であればtrueを返す。

	bool result_ac_bd = get_cross( a , b , c , d ); // 線分acと直線bdの交差判定
	bool result_bd_ac = get_cross( b , a , d , c ); // 線分bdと直線acの交差判定

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

bool get_convex_new( const point& a , const point& b , const point& c , const point& d )
{
	bool result_ac_bd;
	bool result_bd_ac;

	if( get_position( a , c , b ) != get_position( a , c , d ) ) result_ac_bd = true;
	else result_ac_bd = false;

	if( get_position( b , d , a ) != get_position( b , d , c ) ) result_bd_ac = true;
	else result_bd_ac = false;

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

typedef complex<double> P;

const double eps = 1e-8;

double heron(P p1, P p2, P p3) {
    double x = abs(p2 - p1), y = abs(p3 - p2), z = abs(p1 - p3);
    double s = (x + y + z) / 2.0;
    return sqrt(s * (s - x) * (s - y) * (s - z));
}

int main() {
    P p[4];
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
          &p[0].real(), &p[0].imag(), &p[1].real(), &p[1].imag(),
                &p[2].real(), &p[2].imag(), &p[3].real(), &p[3].imag()) != EOF) {
        if (abs(heron(p[0], p[1], p[2]) + heron(p[0], p[2], p[3])
                - heron(p[1], p[2], p[3]) - heron(p[1], p[3], p[0])) < eps) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

double cross(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}

string solve(double x[],double y[])
{
	double area=0;
	repi(i,1,3)
		area+=cross(x[i]-x[0],y[i]-y[0],x[i+1]-x[0],y[i+1]-y[0]);
	area=abs(area/2);
	
	rep(i,4){
		double a=abs(cross(x[1]-x[0],y[1]-y[0],x[2]-x[0],y[2]-y[0])/2);
		if(area+1e-10<a)
			return "NO";
		rotate(x,x+1,x+4);
		rotate(y,y+1,y+4);
	}
	return "YES";
}

int main()
{
	for(double x[4],y[4];scanf("%lf,%lf",x,y)==2;){
		repi(i,1,4)
			scanf(",%lf,%lf",x+i,y+i);
		cout<<solve(x,y)<<endl;
	}
	
	return 0;
}