function Main(input) {
    input = input.split("\n");
    const [n, ...arr] = input;
    const d = arr.map(v => v.split(" ").map(v => parseInt(v, 10)));
    
    let zorome = 0;
    for(let i = 0; i < n; i++) {
        if(d[i][0] === d[i][1]) {
            zorome++;
            if(zorome === 3) break;
        } else {
            zorome = 0;
        }
    }

    if(zorome === 3) {
        console.log("Yes");
    } else {
        console.log("No");
    }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));