import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class polygon { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while(true) { String s = in.readLine(); if(s.equals("0")) break; int[] useckyX = new int[Integer.valueOf(s)]; int[] useckyY = new int[Integer.valueOf(s)]; for(int i=0; ix2) { double pom = x1; x1 = x2; x2 = pom; } if(x<=x2 && x>=x1 && (j > i+1)) { x1 = useckyX[j]; x2 = useckyX[(j+1)%useckyX.length]; if(x1>x2) { double pom = x1; x1 = x2; x2 = pom; } if(x<=x2 && x>=x1 && (j > i+1)) { prusecik = true; break; } } } } if(!prusecik) System.out.println("YES"); else System.out.println("NO"); } } }