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(); List list = new ArrayList<>(); for(int a0 = 0; a0 < n; a0++){ int x = in.nextInt(); int y = in.nextInt(); list.add(new Point(x, y)); } boolean result = solve(list); System.out.println(result? "YES" : "NO"); } static boolean solve(List list) { for (int x = -10; x <= 10; x++) { boolean valid = true; for (Point point : list) { if (point.x != x) { valid = false; } } if (valid) return true; } for (int y = -10; y <= 10; y++) { boolean valid = true; for (Point point : list) { if (point.y != y) { valid = false; } } if (valid) return true; } return false; } static class Point { int x, y; public Point(int x, int y) { this.x = x; this.y = y; } } }