import java.util.Scanner; /** * Created by merrillm on 6/20/16. */ public class PointsOnALine { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = scn.nextInt(); int x = scn.nextInt(), y = scn.nextInt(); boolean xb = true, yb = true; for (int i = 1; i < N && (xb || yb); i++) { if (scn.nextInt() != x) xb = false; if (scn.nextInt() != y) yb = false; } System.out.println((xb || yb) ? "YES" : "NO"); } }