let make_list f t step =
  let rec make_list_inner c t lst =
    if c >= t then lst else make_list_inner (c+step) t (c::lst)
  in
  List.rev (make_list_inner f t [])

type side = Left | Right | On

let side x1 y1 x2 y2 px py =
  match px *. (y1 -. y2) +. x1 *. (y2 -. py) +. x2 *. (py -. y1) with
    x when x > 0.0 -> Left
  | x when x < 0.0 -> Right
  | _ -> On

let inside_triangle x1 y1 x2 y2 x3 y3 px py =
  let s1 = side x1 y1 x2 y2 px py
  and s2 = side x2 y2 x3 y3 px py
  and s3 = side x3 y3 x1 y1 px py
  in
  s1 = s2 && s2 = s3 && s1 <> On
    
let () =
  let rec read () =
    try let ans = (Scanf.scanf "%f %f %f %f %f %f %f %f\n" inside_triangle) in
        Printf.printf "%s\n" (if ans then "YES" else "NO");
        read ()
    with End_of_file ->
         ()
  in
  read ()
;;