import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc=new Scanner(System.in); int q=sc.nextInt(); for(int i=0;i=maxx) maxx=x[j]; if(y[j]<=miny) miny=y[j]; if(y[j]>=maxy) maxy=y[j]; } boolean check=false; for(int j=0;j=miny&&y[j]<=maxy))||((y[j]==miny||y[j]==maxy)&&(x[j]>=minx&&x[j]<=maxx))) check= true; else { check=false; break; } } if(check==true) System.out.println("YES"); else System.out.println("NO"); } } }