import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Read as T
import Data.Bool (bool)

main :: IO ()
main = do
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  ds <- map (uncurry (==) . unsafeListToPair . map unsafeTextToInt . T.words) . T.lines <$> T.getContents :: IO [Bool]
  putStrLn . bool "No" "Yes" . any ((True, True, True) ==) . (zip3 <$> id <*> tail <*> tail . tail) $ ds

unsafeListToPair :: [Int] -> (Int, Int)
unsafeListToPair = (,) <$> head <*> head . tail
{-# INLINE unsafeListToPair #-}

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
