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 <bits/stdc++.h>

using namespace std;

namespace geometry
{	
	typedef double D;
	typedef complex<D> P;
	typedef pair<P, P> S;
	typedef S L;
	typedef pair<P, D> C;
	
	#define EPS 		(1e-10)
	#define EQ(a, b) 	(abs((a) - (b)) < EPS)
	#define EQV(a, b) 	(EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
	
	static const int COUNTER_CLOCKWISE 	=  1;
	static const int CLOCKWISE			= -1;
	static const int ONLINE_BACK		=  2;
	static const int ONLINE_FRONT		= -2;
	static const int ON_SEGMENT			=  0;
	
	bool cmp(const P& a, const P& b){
		if (a.real() != b.real()) return a.real() < b.real();
		return a.imag() < b.imag();
	}
	
	void debug(P p){
		printf("x: %f, y: %f\n", p.real(), p.imag()); 
	}
	void debug(C c){
		printf("x: %f, y: %f, r: %f\n", c.first.real(), c.first.imag(), c.second);
	}
	void debug(S s){
		printf("{\n");
		printf("    ");
		debug(s.first);
		printf("    ");
		debug(s.second);
		printf("}\n");
	}
	void debug(vector<P> poly){
		printf("{\n");
		for (int i = 0; i < poly.size(); i++){
			printf("    ");
			debug(poly[i]);
		}
		printf("}\n");
	}
	
	D norm(P a) { return a.real() * a.real() + a.imag() * a.imag(); }
	
	D dot(P a, P b) { return a.real() * b.real() + a.imag() * b.imag(); }
	D cross(P a, P b) { return a.real() * b.imag() - a.imag() * b.real(); }
	
	bool isOrthogonal(P a1, P a2, P b1, P b2) { return EQ(dot(a1 - a2, b1 - b2), 0.0); }
	bool isOrthogonal(L a, L b) { return isOrthogonal(a.first, a.second, b.first, b.second); }
	bool isParallel(P a1, P a2, P b1, P b2) { return EQ(cross(a1 - a2, b1 - b2), 0.0); }
	bool isParallel(L a, L b) { return isParallel(a.first, a.second, b.first, b.second); }
	
	bool isPointOnLine(P a, P b, P c) { return EQ(cross(b - a, c - a), 0.0); }
	bool isPointOnLine(L a, P b) { return isPointOnLine(a.first, a.second, b); }
	bool isPointOnSegment(P a, P b, P c) {
		return EQ(cross(b - a, c - a), 0.0) &&
		       (dot(b - a, c - a) > -EPS) &&
			   (dot(a - b, c - b) > -EPS);
	}
	bool isPointOnSegment(S a, P b) { return isPointOnLine(a.first, a.second, b); }
	
	int ccw(P p0, P p1, P p2){
		P a = p1 - p0;
		P b = p2 - p0;
		if (cross(a, b) > EPS) 	return COUNTER_CLOCKWISE;
		if (cross(a, b) < -EPS) return CLOCKWISE;
		if (dot(a, b) < -EPS)	return ONLINE_BACK;
		if (norm(a) < norm(b))	return ONLINE_FRONT;
		return ON_SEGMENT;
	}
	
	bool intersect(P p1, P p2, P p3, P p4){
		return ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
		       ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0;
	}
	bool intersect(S s1, S s2){
		return intersect(s1.first, s1.second, s2.first, s2.second);
	}
	
	D distanceLP(P a, P b, P c) { return abs(cross(b - a, c - a)) / abs(b - a); }
	D distanceLP(L a, P b) { return distanceLP(a.first, a.second, b); }
	D distanceSP(P a, P b, P c) {
		if (dot(b - a, c - a) < EPS) return abs(c - a);
		if (dot(a - b, c - b) < EPS) return abs(c - b);
		return abs(cross(b - a, c - a)) / abs(b - a);
	}
	D distanceSP(S a, P b) { return distanceSP(a.first, a.second, b); }
	
	bool intersectCL(C c, L l){
		return c.second - distanceLP(l, c.first) > -EPS;
	}
	bool intersectCS(C c, S s){
		if (EQ(c.second - abs(c.first - s.first), 0.0) ||
			EQ(c.second - abs(c.first - s.second), 0.0)) return true;
		if (c.second - distanceSP(s, c.first) > -EPS){
			return (c.second - abs(c.first - s.first) < EPS ||
				    c.second - abs(c.first - s.second) < EPS);
		}
		return false;
	}
	
	P project(S s, P p){
		P base = s.second - s.first;
		D r = dot(p - s.first, base) / norm(base);
		return s.first + base * r;
	}
	P reflect(S s, P p){
		return p + (project(s, p) - p) * (D)2.0;
	}
	
	P crossPoint(S s1, S s2){
		P base = s2.second - s2.first;
		D d1 = abs(cross(base, s1.first - s2.first));
		D d2 = abs(cross(base, s1.second - s2.first));
		D t = d1 / (d1 + d2);
		return s1.first + (s1.second - s1.first) * t;
	}
	
	D area(vector<P> poly){
		if (poly.size() < 3) return 0.0;
		D res = 0.0;
		for (int i = 0; i < poly.size() - 2; i++){
			P v1 = poly[i + 1] - poly[i];
			P v2 = poly[i + 2] - poly[i];
			res += abs(cross(v1, v2)) / 2;
		}
		return res;
	}
	
	vector<P> convexHull(vector<P> s){
		if (s.size() < 3) return s;
		vector<P> u, l;
		sort(s.begin(), s.end(), cmp);
		//debug(s);
		u.push_back(s[0]);
		u.push_back(s[1]);
		l.push_back(s[s.size() - 1]);
		l.push_back(s[s.size() - 2]);
		for (int i = 2; i < s.size(); i++){
			for (int n = u.size(); n >= 2 && ccw(u[n - 2], u[n - 1], s[i]) != CLOCKWISE/* && ccw(u[n - 2], u[n - 1], s[i]) != ONLINE_FRONT*/; n--){
				u.pop_back();
			}
			u.push_back(s[i]);
		}
		for (int i = s.size() - 3; i >= 0; i--){
			for (int n = l.size(); n >= 2 && ccw(l[n - 2], l[n - 1], s[i]) != CLOCKWISE/* && ccw(l[n - 2], l[n - 1], s[i]) != ONLINE_FRONT*/; n--){
				l.pop_back();
			}
			l.push_back(s[i]);
		}
		reverse(l.begin(), l.end());
		for (int i = u.size() - 2; i >= 1; i--){
			l.push_back(u[i]);
		}
		return l;
	}
}

using namespace geometry;

int main()
{
	D a[8];
	char c;
	while (cin >> a[0] >> c >> a[1]){
		for (int i = 2; i < 8; i++){
			cin >> c >> a[i];
		}
		vector<P> p;
		for (int i = 0; i < 4; i++){
			p.push_back(P(a[i * 2], a[i * 2 + 1]));
		}
		vector<P> r = convexHull(p);
		if (r.size() == 4) puts("YES");
		else puts("NO");
		fflush(stdin);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <ctime>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int const MOD = 1000000007;

// 2???????????????????????????????±???????
double dot(P a, P b) {
    return (a.X * b.X + a.Y * b.Y);
}

// 2???????????????????????????????±???????
double cross(P a, P b) {
    return (a.X * b.Y - a.Y * b.X);
}

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

int main() {
    P a, b, c, d;
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a.X, &a.Y, &b.X, &b.Y, &c.X, &c.Y, &d.X, &d.Y)) {
        int p,q,r,s;
        p = ccw(a,c,b);
        q = ccw(b,d,c);
        r = ccw(c,a,d);
        s = ccw(d,b,a);
        if(p == q && q == r && r == s && abs(s) == 1) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}