import Control.Monad
main = do
    n <- readLn
    numlists <- replicateM n (fmap (map read.words) getLine)
    mapM_ (yesOrNo.foldl (>>=) (Just (0,0)).map insert) numlists

yesOrNo x = case x of
              Just _ -> putStrLn "YES"
              Nothing -> putStrLn "NO"

insert n (l,r)
  | l < n = Just (n,r)
  | r < n = Just (l,n)
  | otherwise = Nothing