hasIntersection :: [Double] -> String
hasIntersection [xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2]
    | not (xb1 > xa2 || yb1 > ya2 || xb2 < xa1 || yb2 < ya1) = "YES"
    | otherwise                                              = "NO"

main :: IO ()
main = putStr . unlines . map hasIntersection . map (map read) . map words . lines =<< getContents