const input = require("fs").readFileSync("/dev/stdin", "utf8")

const lines = input.split('\n')
let N = lines[0].trim() - 0

const D = []
for (let i = 0; i < N; i++) {
    D[i] = lines[i + 1].split(' ').map(Number)
}

let ans = 'No'

let count = 0
for (let i = 0; i < N; i++) {
    if (D[i][0] === D[i][1]) {
        count++
        if (count === 3) {
            ans = 'Yes'
            break
        }
    } else {
        count = 0
    }
}

console.log(ans)
