#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define X real()
#define Y imag()
#define EQ(a,b) (abs((a)-(b))<EPS)
typedef complex<double> Po;
double isIntersect(Po p1,Po p2,Po p3,Po p4)
{
	//straight line(p1,p2) and line segment(p3,p4) are
	//if(n<0) crossed if(n==0) parallel if(n>0) not crossed
	return ((p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X));
}
int main()
{
	double x[4];
	double y[4];
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]))
	{
	Po p[4];
	for(int i=0;i<4;i++)
	{
		p[i].X=x[i];
		p[i].Y=y[i];
	}
	if(isIntersect(p[0],p[2],p[1],p[3])>0.0||isIntersect(p[1],p[3],p[0],p[2])>0.0)
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "OK" << endl;
	}
	}
	return 0;
}