function Main(input) {
	const list = input.split("\n");
	const parse = (input) => parseInt(input.trim(), 10);
	let cnt = 0;
	let ans = 'No';
	for(let i = 1; i <= parse(list[0]); i++){
		let D = list[i].split(" ");
		cnt = D[0] == D[1] ? cnt + 1 : 0;
		if(cnt === 3) {
			ans = 'Yes';
			break;
		}
	}
	console.log(ans);
};

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
