sub g {
    ($x0,$y0)=$_[0]=~/\S+/g;
    ($x1,$y1)=$_[1]=~/\S+/g;
    ($x2,$y2)=$_[2]=~/\S+/g;
    ($x3,$y3)=$_[3]=~/\S+/g;
    $x1-=$x0;$y1-=$y0;
    $x2-=$x0;$y2-=$y0;
    $x3-=$x0;$y3-=$y0;
    ($x1*$y2-$y1*$x2)*($x1*$y3-$y1*$x3)<0;
}

sub f {
    g($_[0],$_[1],$_[2],$_[3])||
    g($_[1],$_[2],$_[0],$_[3])||
    g($_[2],$_[0],$_[1],$_[3])||
    exit!print"NO";
}

@z=<>;
f $z[0],$z[1],$z[2],$z[3];
f $z[0],$z[1],$z[2],$z[4];
f $z[0],$z[1],$z[3],$z[2];
f $z[0],$z[1],$z[3],$z[4];
f $z[0],$z[1],$z[4],$z[2];
f $z[0],$z[1],$z[4],$z[3];
f $z[0],$z[2],$z[3],$z[1];
f $z[0],$z[2],$z[3],$z[4];
f $z[0],$z[2],$z[4],$z[1];
f $z[0],$z[2],$z[4],$z[3];
f $z[0],$z[3],$z[4],$z[1];
f $z[0],$z[3],$z[4],$z[2];
f $z[1],$z[2],$z[3],$z[0];
f $z[1],$z[2],$z[3],$z[4];
f $z[1],$z[2],$z[4],$z[0];
f $z[1],$z[2],$z[4],$z[3];
f $z[1],$z[3],$z[4],$z[0];
f $z[1],$z[3],$z[4],$z[2];
f $z[2],$z[3],$z[4],$z[0];
f $z[2],$z[3],$z[4],$z[1];
print"YES";