while line = gets do
    break if line == nil
    x1, y1, x2, y2, x3, y3, xp, yp = line.split(" ").map{|item| item.to_f}
    
#または 
#readlines.each do |i|
#    x1, y1, x2, y2, x3, y3, xp, yp = i.split(" ").map{|item| item.to_f}

    def c(x1, y1, x2, y2, x, y)
        (y2 - y1)*(x - x1) - (x2 - x1)*(y - y1)
    end

    gx, gy = (x1 + x2 + x3) / 3, (y1 + y2 + y3) / 3
    
    r1 = c(x1, y1, x2, y2, gx, gy)*c(x1, y1, x2, y2, xp, yp) > 0
    r2 = c(x2, y2, x3, y3, gx, gy)*c(x2, y2, x3, y3, xp, yp) > 0
    r3 = c(x3, y3, x1, y1, gx, gy)*c(x3, y3, x1, y1, xp, yp) > 0
    puts (r1 && r2 && r3) ? "YES" : "NO"
end

#または
#if (r1 && r2 && r3) then puts "YES"
#else puts "NO"




#条件演算子の && ||
#「かつ」を表す条件演算子 &&
#「または」を表す条件演算子 ||
#(例)true && false = false　false && false = false　true && true = false
#(例)true || false = true  true || true = true

