import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); boolean[] xc= new boolean [25]; boolean[] yc= new boolean [25]; for(int a0 = 0; a0 < n; a0++){ int x = in.nextInt(); int y = in.nextInt(); if(y<0){ y= Math.abs(y); } else if(y==0){ y=11; } else if(y>=1){ y+=11; } if(x>=1){ x+=11; } else if(x<0){ x= Math.abs(x); } else if(x==0){ x=11; } xc[x]= true; yc[y]= true; } int countx= 0, county=0; for(int i=0; i<25; i++){ if(xc[i]==true){ countx++; } if(yc[i]==true){ county++; } } if(countx==1 && county==n){ System.out.println("YES"); } else if(county==1 && countx==n){ System.out.println("YES"); } else{ System.out.println("NO"); } } }