import java.util.*; public class PointOnALine { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[][] a = new int[n][2]; for(int i = 0 ;i < n; i ++) { a[i][0] = in.nextInt(); a[i][1] = in.nextInt(); } boolean same_line = true; int x = a[0][0]; for(int i = 1 ;i < n; i ++) { if( x != a[i][0]) same_line = false; } if(same_line) { System.out.println("YES"); System.exit(0);} same_line = true; int y = a[0][1]; for(int i = 1 ;i < n; i ++) { if( y != a[i][1]) same_line = false; } if(same_line) { System.out.println("YES"); System.exit(0); } System.out.println("NO"); in.close(); } }