Given the coordinates of four distinct points on a plane, namely $A (x_a, y_a)$, $B (x_b, y_b)$, $C (x_c, y_c)$, and $D(x_d, y_d)$, create a program to determine if the quadrilateral formed by these points (ABCD) is convex. If it is convex, output YES; otherwise, output NO. A convex quadrilateral is one without any indentations, as shown in Figure 1. The input consists of multiple datasets, each containing the coordinates $x_a$, $y_a$, $x_b$, $y_b$, $x_c$, $y_c$, $x_d$, and $y_d, all within the range of -100 to 100. It is guaranteed that no three points are collinear, and the input order of the points forms a valid quadrilateral. The number of datasets does not exceed 100. For each dataset, output YES or NO on a separate line. Example input and output are provided.

# Buggy version:
while True:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split(','))
        p = (x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)
        q = (x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)
        r = (x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)
        s = (x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)
        if p * q < 0 and r * s < 0:
            print("YES")
        else:
            print("NO")
    except EOFError: break

# Fixed version:
def f(x1,y1,x2,y2,x3,y3,x4,y4):
    p = (x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)
    q = (x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)
    r = (x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)
    s = (x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)
    return p * q < 0 and r * s < 0

while True:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split(','))
    except EOFError:
        break
    if f(x1,y1,x3,y3,x2,y2,x4,y4):
        print('YES')
    else:
        print('NO')

# Buggy version:
import sys
for line in sys.stdin():
    p = list(map(float, line.split(',')))
    v = [p[i] - p[(i + 2) % 8] for i in range(8)]
    ip = [v[j] * v[(j + 3) % 8] - v[j + 1] * v[(j + 2) % 8] > 0 for j in range(0,8,2)]
    if sum(ip) == 0 or sum(ip) == 4:
        print('YES')
    else:
        print('NO')

# Fixed version:
import sys
for line in sys.stdin:
    try:
        p = list(map(float, line.split(',')))
    except:
        break
    v = [p[i] - p[(i + 2) % 8] for i in range(8)]
    ip = [v[j] * v[(j + 3) % 8] - v[j + 1] * v[(j + 2) % 8] > 0 for j in range(0,8,2)]
    if sum(ip) == 0 or sum(ip) == 4:
        print('YES')
    else:
        print('NO')

# Buggy version:
def judge(p1,p2,p3,p4):
    t1 = (p1[0] - p3[0]) * (p2[1] - p1[1]) + (p1[1] - p3[1]) * (p1[0] - p2[0])
    t2 = (p1[0] - p3[0]) * (p4[1] - p1[1]) + (p1[1] - p3[1]) * (p1[0] - p4[0])
    t3 = (p2[0] - p4[0]) * (p1[1] - p2[1]) + (p2[1] - p4[1]) * (p2[0] - p1[0])
    t4 = (p2[0] - p4[0]) * (p3[1] - p2[1]) + (p2[1] - p4[1]) * (p2[0] - p3[0])
    return t1*t2<0 and t3*t4<0
while True:
	try:
		x1,y1,x2,y2,x3,y3,x4,y4=map(float, input().split(","))
		A=[x1,y1]
		B=[x2,y2]
		C=[x3,y3]
		D=[x4,y4]
		print(A,B,C,D)
		if judge(A,B,C,D)==True or judge(A,D,B,C)==True :
			print("YES")
		else:
			print("NO")
	except EOFError:
		break


# Fixed version:
def judge(p1,p2,p3,p4):
    t1 = (p3[0] - p4[0]) * (p1[1] - p3[1]) + (p3[1] - p4[1]) * (p3[0] - p1[0])
    t2 = (p3[0] - p4[0]) * (p2[1] - p3[1]) + (p3[1] - p4[1]) * (p3[0] - p2[0])
    t3 = (p1[0] - p2[0]) * (p3[1] - p1[1]) + (p1[1] - p2[1]) * (p1[0] - p3[0])
    t4 = (p1[0] - p2[0]) * (p4[1] - p1[1]) + (p1[1] - p2[1]) * (p1[0] - p4[0])
    return t1*t2>0 and t3*t4>0 
while True:
	try:
		x1,y1,x2,y2,x3,y3,x4,y4=map(float, input().split(","))
		A=[x1,y1]
		B=[x2,y2]
		C=[x3,y3]
		D=[x4,y4]
		if judge(A,B,C,D)==False :
			print("NO")
		else:
			print("YES")
	except EOFError:
		break