chk (xa1,ya1) (xa2,ya2) (xp,yp) =
  let xmin = min xa1 xa2
      ymin = min ya1 ya2
      xmax = max xa1 xa2
      ymax = max ya1 ya2
  in
    (xmin <= xp && xp <= xmax) && (ymin <= yp && yp <= ymax)

ans (xa1:ya1:xa2:ya2:xb1:yb1:xb2:yb2:_) =
  let c = [(xb1,yb1),(xb2,yb2),(xb1,yb2),(xb2,yb1)]
      a = map (chk (xa1,ya1) (xa2,ya2)) c
  in
    if elem True a; then "YES"; else "NO"

main = do
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Double]]
      o = map ans i
  mapM_ putStrLn o
  