let () =
  let rec read () =
    try let xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 =
          Scanf.scanf " %f %f %f %f %f %f %f %f\n" (fun q r s t w x y z -> (q,r,s,t,w,x,y,z)) in
        let f x y = x <= xa2 && x >= xa1 && y <= ya2 && y >= ya1 in
        if (f xb1 yb1) || (f xb1 yb2) || (f xb2 yb1) || (f xb2 yb2) then
          print_endline "YES"
        else
          print_endline "NO"
        ;read ()
    with End_of_file -> ()
  in read ()
;;