import Control.Applicative

data YesNo = YES | NO deriving(Show)
type Coord = (Double, Double)


sub :: Coord -> Coord -> Coord
sub a b = (fst a - fst b, snd a - snd b)

oProduct :: Coord -> Coord -> Double
oProduct x y = fst x * snd y - snd x * fst y

reshape :: [Double] -> [Coord]
reshape [] = []
reshape [_] = []
reshape (x:y:rs) = (x, y) : reshape rs


isInside :: [Coord] -> YesNo
isInside [] = NO
isInside [_] = NO
isInside [_, _] = NO
isInside [_, _, _] = NO
isInside (a:b:c:p:_) =
  let cand1 = oProduct (b `sub` a) (p `sub` a)
      cand2 = oProduct (c `sub` b) (p `sub` b)
      cand3 = oProduct (a `sub` c) (p `sub` c)
  in
    if (cand1 < 0 && cand2 < 0 && cand3 < 0)
      || (cand1 > 0 && cand2 > 0 && cand3 > 0)
      then YES
      else NO


solver :: [[Coord]] -> [YesNo]
solver = map isInside

main :: IO()
main = do
  contents <- map (map (read :: String -> Double) . words) . lines <$> getContents
  mapM_ print $ solver $ map reshape contents