import Control.Applicative

main :: IO ()
main = do
    xss <- map (map read . words) . lines <$> getContents
    mapM_ putStrLn $ solve xss

solve :: [[Float]] -> [String]
solve [] = []
solve (x:xs) = solve':(solve xs)
    where
        [x1,y1,x2,y2,x3,y3,xp,yp] = x
        a = (x2 - x1) * (xp - y2) - (y2 - y1) * (xp - x2)
        b = (x3 - x2) * (yp - y3) - (y3 - y2) * (xp - x3)
        c = (x1 - x3) * (yp - y1) - (y1 - y3) * (xp - x1)
        solve' = if and [a > 0, b > 0, c > 0]
                   then "YES"
                   else "NO"