rectVertex :: (Double,Double)->(Double,Double)->[(Double,Double)]
rectVertex (x1,y1) (x2,y2) = [(x1,y1),(x1,y2),(x2,y1),(x2,y2)]

inRect :: (Double,Double)->(Double,Double)->(Double,Double)->Bool
inRect (x1,y1) (x2,y2) (x,y) = x1<=x && x<=x2 && y1<=y && y<=y2

interactRect ::(Double,Double)->(Double,Double)->(Double,Double)->(Double,Double)->Bool
interactRect a1 a2 b1 b2 = or $ map (inRect a1 a2) $ rectVertex b1 b2

solve :: String->IO ()
solve line = do
    let dat = map (\x->read x::Double) $ words line
    let a1 = (dat!!0, dat!!1)
    let a2 = (dat!!2, dat!!3)
    let b1 = (dat!!4, dat!!5)
    let b2 = (dat!!6, dat!!7)
    if interactRect a1 a2 b1 b2 then putStrLn "YES" else putStrLn "NO"

main :: IO ()
main = do
    str <- getContents 
    mapM_ solve $ lines $ str