
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main{
	static int len=0;
	static long[] a=new long[10];
	static long[] segment_tree=new long[10];
	static int d=0;
	static int left(int p)
	{
		return 2*p;
	}
	static int right(int p)
	{
		return 2*p+1;
	}
	static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} 
	static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	}
	static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	}
	static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	}
	static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	}
	static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	}
	static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	}
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static long mod=1000000007;
	static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } 
    static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } 
    static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	}
    public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    }
} import java.io.*; io.* java import java.math.*; math.* java import java.security.*; security.* java import java.text.*; text.* java import java.util.*; util.* java import java.util.concurrent.*; concurrent.* java.util import java.util.regex.*; regex.* java.util public class Main{
	static int len=0;
	static long[] a=new long[10];
	static long[] segment_tree=new long[10];
	static int d=0;
	static int left(int p)
	{
		return 2*p;
	}
	static int right(int p)
	{
		return 2*p+1;
	}
	static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} 
	static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	}
	static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	}
	static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	}
	static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	}
	static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	}
	static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	}
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static long mod=1000000007;
	static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } 
    static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } 
    static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	}
    public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    }
} Main static int len=0; len 0 static long[] a=new long[10]; a new long[10] 10 static long[] segment_tree=new long[10]; segment_tree new long[10] 10 static int d=0; d 0 static BufferedReader br; br static long mod=1000000007; mod 1000000007 static int left(int p)
	{
		return 2*p;
	} left {
		return 2*p;
	} return 2*p; 2*p 2 p int p p static int right(int p)
	{
		return 2*p+1;
	} right {
		return 2*p+1;
	} return 2*p+1; 2*p+1 2*p 2 p 1 int p p static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} parent {
		return (int) Math.floor(p/2.0);
	} return (int) Math.floor(p/2.0); (int) Math.floor(p/2.0) Math.floor Math p/2.0 p 2.0 int p p static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	} build_segment_tree {
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	} if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		} L==R L R segment_tree[p]=a[L] segment_tree[p] segment_tree p a[L] a L {
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		} build_segment_tree(left(p),L,(L+R)/2) build_segment_tree left(p) left p L (L+R)/2 (L+R) L R 2 build_segment_tree(right(p),((L+R)/2)+1,R) build_segment_tree right(p) right p ((L+R)/2)+1 ((L+R)/2) (L+R) L R 2 1 R long x=segment_tree[left(p)]; x segment_tree[left(p)] segment_tree left(p) left p long y=segment_tree[right(p)]; y segment_tree[right(p)] segment_tree right(p) right p if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x; x<=y x y segment_tree[p]=y segment_tree[p] segment_tree p y segment_tree[p]=x segment_tree[p] segment_tree p x int p p int L L int R R static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	} rmq {
		return rmq_helper(1,0,len-1,i,j);
	} return rmq_helper(1,0,len-1,i,j); rmq_helper(1,0,len-1,i,j) rmq_helper 1 0 len-1 len 1 i j int i i int j j static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	} rmq_helper {
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	} if(j<L || i>R)
		{
			return -1;
		} j<L || i>R j<L j L i>R i R {
			return -1;
		} return -1; -1 1 if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		} i<=L && j>=R i<=L i L j>=R j R return segment_tree[p]; segment_tree[p] segment_tree p {
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		} long x=rmq_helper(left(p),L,(L+R)/2,i,j); x rmq_helper(left(p),L,(L+R)/2,i,j) rmq_helper left(p) left p L (L+R)/2 (L+R) L R 2 i j long y=rmq_helper(right(p),(L+R)/2+1,R,i,j); y rmq_helper(right(p),(L+R)/2+1,R,i,j) rmq_helper right(p) right p (L+R)/2+1 (L+R)/2 (L+R) L R 2 1 R i j if(x==-1)
				return y; x==-1 x -1 1 return y; y if(y==-1)
				return x; y==-1 y -1 1 return x; x return Math.max(x,y); Math.max(x,y) Math.max Math x y int p p int L L int R R int i i int j j static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	} update {
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	} a[index]=value a[index] a index value d=0 d 0 update_helper1(1,0,len-1,index) update_helper1 1 0 len-1 len 1 index segment_tree[d]=value segment_tree[d] segment_tree d value update_helper2(d) update_helper2 d int index index long value value static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	} update_helper2 {
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	} while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		} true {
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		} d=parent(d) d parent(d) parent d if(d==0)
				break; d==0 d 0 break; long x=segment_tree[right(d)]; x segment_tree[right(d)] segment_tree right(d) right d long y=segment_tree[left(d)]; y segment_tree[left(d)] segment_tree left(d) left d if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x; x<=y x y segment_tree[d]=y segment_tree[d] segment_tree d y segment_tree[d]=x segment_tree[d] segment_tree d x int d d static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	} update_helper1 {
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	} if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index); L==index && R==index L==index L index R==index R index {
			d=p;
			return;
		} d=p d p return; if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index); L<=index && index<=(L+R)/2 L<=index L index index<=(L+R)/2 index (L+R)/2 (L+R) L R 2 update_helper1(left(p),L,(L+R)/2,index) update_helper1 left(p) left p L (L+R)/2 (L+R) L R 2 index if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index); (L+R)/2+1<=index && index<=R (L+R)/2+1<=index (L+R)/2+1 (L+R)/2 (L+R) L R 2 1 index index<=R index R update_helper1(right(p),(L+R)/2+1,R,index) update_helper1 right(p) right p (L+R)/2+1 (L+R)/2 (L+R) L R 2 1 R index int p p int L L int R R int index index static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	} cin {
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	} return Integer.valueOf(br.readLine().replaceAll("\\s", "")); Integer.valueOf(br.readLine().replaceAll("\\s", "")) Integer.valueOf Integer br.readLine().replaceAll("\\s", "") br.readLine().replaceAll br.readLine() br.readLine br "\\s" "" static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} split {
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} String[] cmd=br.readLine().split(" "); cmd br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] ans=new int[cmd.length]; ans new int[cmd.length] cmd.length cmd cmd.length for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		} int i=0; int i=0; i 0 i<cmd.length i cmd.length cmd cmd.length i++ i++ i {
			ans[i]=Integer.valueOf(cmd[i]);
		} {
			ans[i]=Integer.valueOf(cmd[i]);
		} ans[i]=Integer.valueOf(cmd[i]) ans[i] ans i Integer.valueOf(cmd[i]) Integer.valueOf Integer cmd[i] cmd i return ans; ans static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	} splitL {
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	} String[] cmd=br.readLine().split(" "); cmd br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] ans=new long[cmd.length]; ans new long[cmd.length] cmd.length cmd cmd.length for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		} int i=0; int i=0; i 0 i<cmd.length i cmd.length cmd cmd.length i++ i++ i {
			ans[i]=Long.valueOf(cmd[i]);
		} {
			ans[i]=Long.valueOf(cmd[i]);
		} ans[i]=Long.valueOf(cmd[i]) ans[i] ans i Long.valueOf(cmd[i]) Long.valueOf Long cmd[i] cmd i return ans; ans static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } power { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } long res = 1; res 1 x = x % mod x x % mod x mod while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } y > 0 y 0 { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } if (y % 2 == 1) 
                res = (res * x) % mod; y % 2 == 1 y % 2 y 2 1 res = (res * x) % mod res (res * x) % mod (res * x) res x mod y = y >> 1 y y >> 1 y 1 x = (x * x) % mod x (x * x) % mod (x * x) x x mod return res%mod; res%mod res mod long x x long y y static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } modInverse { 
        return power(n, mod-2); 
    } return power(n, mod-2); power(n, mod-2) power n mod-2 mod 2 long n n static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	} gcd {
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	} if(a==0)
			return b; a==0 a 0 return b; b if(b==0)
			return a; b==0 b 0 return a; a if(a>b)
			return gcd(a%b,b); a>b a b return gcd(a%b,b); gcd(a%b,b) gcd a%b a b b return gcd(a,b%a); gcd(a,b%a) gcd a b%a b a long a a long b b public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    } main {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    } br=new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out)); writer new BufferedWriter(new OutputStreamWriter(System.out)) int n=cin(); n cin() cin int[]arr=new int[n]; arr new int[n] n for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	} {
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	} int[]ar=split(); ar split() split arr[i]=ar[0]-ar[1] arr[i] arr i ar[0]-ar[1] ar[0] ar 0 ar[1] ar 1 boolean b=false; b false int cnt=0; cnt 0 for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	} {
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	} if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		} arr[i]==0 arr[i] arr i 0 cnt++ cnt {
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		} if(cnt>=3)
    			{
    				b=true;
    				break;
    			} cnt>=3 cnt 3 {
    				b=true;
    				break;
    			} b=true b true break; cnt=0 cnt 0 if(cnt>=3)
    		b=true; cnt>=3 cnt 3 b=true b true if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No"); b System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main{
	static int len=0;
	static long[] a=new long[10];
	static long[] segment_tree=new long[10];
	static int d=0;
	static int left(int p)
	{
		return 2*p;
	}
	static int right(int p)
	{
		return 2*p+1;
	}
	static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} 
	static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	}
	static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	}
	static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	}
	static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	}
	static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	}
	static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	}
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static long mod=1000000007;
	static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } 
    static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } 
    static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	}
    public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    }
} public class Main{
	static int len=0;
	static long[] a=new long[10];
	static long[] segment_tree=new long[10];
	static int d=0;
	static int left(int p)
	{
		return 2*p;
	}
	static int right(int p)
	{
		return 2*p+1;
	}
	static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} 
	static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	}
	static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	}
	static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	}
	static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	}
	static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	}
	static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	}
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static long mod=1000000007;
	static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } 
    static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } 
    static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	}
    public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    }
} Main

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main{
	static int len=0;
	static long[] a=new long[10];
	static long[] segment_tree=new long[10];
	static int d=0;
	static int left(int p)
	{
		return 2*p;
	}
	static int right(int p)
	{
		return 2*p+1;
	}
	static int parent(int p)
	{
		return (int) Math.floor(p/2.0);
	} 
	static void build_segment_tree(int p,int L,int R)
	{
		if(L==R)
			segment_tree[p]=a[L]; 
		else
		{
			build_segment_tree(left(p),L,(L+R)/2);
			build_segment_tree(right(p),((L+R)/2)+1,R);
			long x=segment_tree[left(p)];
			long y=segment_tree[right(p)];
			if(x<=y)
				segment_tree[p]=y;
			else
				segment_tree[p]=x;
		}
	}
	static long rmq(int i,int j)
	{
		return rmq_helper(1,0,len-1,i,j);
	}
	static long rmq_helper(int p,int L,int R,int i,int j)
	{
		if(j<L || i>R)
		{
			return -1;
		}
		if(i<=L && j>=R)
			return segment_tree[p];
		else
		{
			long x=rmq_helper(left(p),L,(L+R)/2,i,j);
			long y=rmq_helper(right(p),(L+R)/2+1,R,i,j);
			if(x==-1)
				return y;
			if(y==-1)
				return x;
			return Math.max(x,y);
		}
	}
	static void update(int index,long value)
	{
		a[index]=value;
		d=0;
		update_helper1(1,0,len-1,index);
		segment_tree[d]=value;
		update_helper2(d);
	}
	static void update_helper2(int d)
	{
		while(true)
		{
			d=parent(d);
			if(d==0)
				break;
			long x=segment_tree[right(d)];
			long y=segment_tree[left(d)];
			if(x<=y)
				segment_tree[d]=y;
			else
				segment_tree[d]=x;
		}
	}
	static void update_helper1(int p,int L,int R,int index)
	{
		if(L==index && R==index)
		{
			d=p;
			return;
		}
		else if(L<=index && index<=(L+R)/2)
			update_helper1(left(p),L,(L+R)/2,index);
		else if((L+R)/2+1<=index && index<=R)
			update_helper1(right(p),(L+R)/2+1,R,index);
	}
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine().replaceAll("\\s", ""));
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static long mod=1000000007;
	static long power(long x,long y) 
    { 
        long res = 1; 
        x = x % mod; 
        while (y > 0) { 
            if (y % 2 == 1) 
                res = (res * x) % mod; 
            y = y >> 1;
            x = (x * x) % mod; 
        } 
        return res%mod; 
    } 
    static long modInverse(long n) 
    { 
        return power(n, mod-2); 
    } 
    static long gcd(long a,long b)
	{
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a>b)
			return gcd(a%b,b);
		return gcd(a,b%a);
	}
    public static void main(String[] args) throws Exception {
    	br=new BufferedReader(new InputStreamReader(System.in));
    	BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
    	int n=cin();
    	int[]arr=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		int[]ar=split();
    		arr[i]=ar[0]-ar[1];
    	}
    	boolean b=false;
    	int cnt=0;
    	for(int i=0;i<n;i++)
    	{
    		if(arr[i]==0)
    			cnt++;
    		else
    		{
    			if(cnt>=3)
    			{
    				b=true;
    				break;
    			}
    			cnt=0;
    		}
    	}
    	if(cnt>=3)
    		b=true;
    	if(b)
    		System.out.println("Yes");
    	else
    		System.out.println("No");
    }
}