
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val s = sc.nextInt()
  val d = Array.fill(s)(sc.nextInt(), sc.nextInt())
  val ret = d.sliding(3).exists{
    l => l(0)._1 == l(0)._2 && l(1)._1 == l(1)._2 && l(2)._1 == l(2)._2
  }    
  println(if(ret) "Yes" else "No")
}
