#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[201],s=0,b;
	cin>>n;
	for(int i=1;i<=n*2;i++){
		
		cin>>a[i];
		
		if(i%2==0){
			if(a[i]==a[i-1])s++;
			else s=0;
		} 
		
		if(s==3){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
}