module Rectangle =
  struct
    type t = { ldx: float; ldy: float; rux: float; ruy: float }
    let eps = 1e-10
    let set x1 y1 x2 y2 = {ldx = x1; ldy = y1; rux = x2; ruy = y2}
    let is_overlap r1 r2 =
      (eps > (r2.ldx -. r1.rux)) &&
      (eps > (r1.ldx -. r2.rux)) &&
      (eps > (r2.ldy -. r1.ruy)) &&
      (eps > (r1.ldy -. r2.ruy))
  end

let _ =
  try
    while true do
      let r1, r2 = Scanf.scanf "%f %f %f %f %f %f %f %f\n" (fun x1 y1 x2 y2 x3 y3 x4 y4 -> (Rectangle.set x1 y1 x2 y2, Rectangle.set x3 y3 x4 y4)) in
      Printf.printf "%s\n" (if Rectangle.is_overlap r1 r2 then "YES" else "NO")
    done
  with
    End_of_file -> ()