
import scala.io.StdIn

object Main extends App {
  val n = StdIn.readInt()
  val d = for(i <- 1 to n)yield{
    val Array(d1,d2,_*) = StdIn.readLine().split(' ').map(_.toInt)
    (d1,d2)
  }

  val ans = d.map(tup => if(tup._1 == tup._2) true else false)
    .scanLeft(0)((sum,b) => if(b) sum + 1 else 0)
    .max >= 3

  print(if (ans) "Yes" else "No")


}





