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 <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>
#include <sstream>

using namespace std;

double EPS = 1e-12;

//誤差を考慮して足し算を行う
double add(double a, double b) {
	if( abs(a + b) < EPS * (abs(a) + abs(b))) {
		return 0;
	}

	return a + b;
}

//二次元ベクトル構造体
struct P {
	double x, y;

	P() {};
	P(double x, double y) : x(x), y(y) {
	}
	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d) {
		return P(x * d, y * d);
	}
	double dot(P p) {	//　内積
		return add(x * p.x, y * p.y);
	}
	double det(P p) {	//　外積
		return add(x * p.y, -y * p.x);
	}
};

//　線分p1-p2上に点qがあるか判定
bool on_seg(P p1, P p2, P q) {
		return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

//　直線p1-p2と直線q1-q2の交点
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

int ccw(P a, P b, P c) {
	a = b - a;
	b = b - c;

	if(a.det(b) < 0) {
		return -1;
	} else if(a.det(b) > 0) {
		return 1;
	}

	return 0;
}


int main() {

	string str;
    while (getline(cin, str)) {
        replace(str.begin(), str.end(), ',', ' ');
        stringstream buf(str);
        P p[4];
        for (int i = 0; i < 4; i++) {
            buf >> p[i].x >> p[i].y;
        }
 
        int cnt = 0, n = 0;
        for (int i = 0; i < 4; i++) {
            int c = ccw(p[i], p[(i+1)%4], p[(i+2)%4]);
            cnt += c;
            n += abs(c);
        }
 
        cout << (abs(cnt) == n ? "YES" : "NO") << endl;
    }
}
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;

double ab,ac,ad,bc,bd,cd;
bool heron();

int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF){
		
		ab = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
		ac = sqrt((xa-xc)*(xa-xc) + (ya-yc)*(ya-yc));
		ad = sqrt((xa-xd)*(xa-xd) + (ya-yd)*(ya-yd));
		bc = sqrt((xb-xc)*(xb-xc) + (yb-yc)*(yb-yc));
		bd = sqrt((xb-xd)*(xb-xd) + (yb-yd)*(yb-yd));
		cd = sqrt((xc-xd)*(xc-xd) + (yc-yd)*(yc-yd));
		
		bool f = heron();
		(f) ? puts("YES") : puts("NO");
	}
	return 0;
}

bool heron(){
	double sq1=0.0,sq2=0.0;
	double S,s;
	
	/*sq1*/
	s = (ab+ac+bc)*0.5;
	S = sqrt(s * (s-ab) * (s-ac) * (s-bc));
	sq1 += S;
	s = (ac+ad+cd)*0.5;
	S = sqrt(s * (s-ac) * (s-ad) * (s-cd));
	sq1 += S;
	
	/*sq2*/
	s = (ab+ad+bd)*0.5;
	S = sqrt(s * (s-ab) * (s-ad) * (s-bd));
	sq2 += S;
	s = (bc+bd+cd)*0.5;
	S = sqrt(s * (s-bc) * (s-bd) * (s-cd));
	sq2 += S;
	bool j;
	(sq1 == sq2) ? j = true : j = false;
	
	return j;
}

C++: #include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <sstream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define bitcount(b) __builtin_popcount(b)
#define all(n) n.begin(),n.end()
typedef pair<double,double> P;
#define x first
#define y second

double tri(P a,P b, P c){
	a.x -= c.x, a.y -= c.y;
	b.x -= c.x, b.y -= c.y;
	c.x -= c.x, c.y -= c.y;
	
	return fabs( b.x * a.y - a.x * b.y ) / 2.0;
}

int main(){
	vector<P> d(4);
	string line;
	while( getline(cin,line) ){
		while(~line.find(","))line[line.find(",")] = ' ';
		stringstream ss(line);
		rep(i,4)ss >> d[i].x >> d[i].y;
		
		double S = tri(d[0],d[2],d[1]) + tri(d[0],d[2],d[3]);
		
		bool flag = true;
		
		rep(i,4){
			double s = tri(d[0],d[2],d[1]) + tri(d[0],d[2],d[3]);
			if( s != S)flag = false;
			rotate(d.begin(),d.begin()+1,d.end());
		}
		cout << (flag?"YES":"NO") << endl;
	}
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

#include <complex>
typedef complex<double> P;

double dot(P a, P b) {
	return (a.real()*b.real() + a.imag()*b.imag());
}

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

int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if(cross(b, c) > 0) return +1;
	if(cross(b, c) < 0) return -1;
	if(dot(b, c) < 0) return +2;
	if(norm(b) < norm(c)) return -2;
	return 0;
}

namespace std {
	bool operator<(const P &a, const P &b) {
		return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
	}
}

vector<P> convex_hull(vector<P> ps) {
	int n = ps.size(), k = 0;
	sort(ALL(ps));
	vector<P> ch(2*n);
	for(int i = 0; i < n; ch[k++] = ps[i++])
		while(k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
	for(int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--])
		while(k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
	ch.resize(k-1);
	return ch;

}

int main() {
	double xa, ya, xb, yb, xc, yc, xd, yd;
	char c;
	while(cin >> xa >> c >> ya >> c >> xb >> c >> yb >> c >> xc >> c >> yc >> c >> xd >> c >> yd) {
		P a(xa, ya), b(xb, yb), c(xc, yc), d(xd, yd);
		vector<P> points;
		points.push_back(a);
		points.push_back(b);
		points.push_back(c);
		points.push_back(d);

		if(convex_hull(points).size() != 4) {
			cout << "NO" << endl;
		} else {
			cout << "YES" << endl;
		}
	}
	return 0;
}