#!ruby -pl
                                            0
x,y,*l=$_.split(?,).map &:to_f
*s,a,b=l.each_slice(2).map{|i,j|[i-x,j-y]}
t,u=s.zip(s.rotate).map{|(a,b),(c,d)|(x*d-y*c)/(a*d-b*c)}
$_=t>0&&u>0&&t+u>1?:YES: :NO