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 yesX = true; boolean yesY = true; for(int a0 = 0; a0 < n; a0++) { int x = in.nextInt(); int y = in.nextInt(); if(x!=0) { yesX=false; if(y!=0) yesY=false; } else if(x==0) { if(y!=0) yesY=false; } } if(yesX||yesY==true) { if(yesX&&yesY==true) System.out.println("NO"); else if (yesX = true) System.out.println("YES"); else if (yesX=false) System.out.println("NO"); else if (yesY = true) System.out.println("YES"); else if (yesY = false) System.out.println("NO"); } else System.out.println("NO"); } }