import scala.io.StdIn._

object Main extends App {


  val n = readInt()
  val d = Array.fill(n)(readLine().split(" ").map(_.toInt))
    .map(list => (list(0) == list(1)))
  def solve(): String = {
    for(i <- 0 to n-3) {
      if(d(i) && d(i+1) && d(i+2)) return "Yes"
    }
    "No"
  }

  println(solve())

}

