import java.util.Collections; import java.util.List; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; class Usecka implements Comparable { int x1, x2, y1, y2, xOld; double a, b, c; int index; Usecka(int x1, int y1, int x2, int y2, int index) { this.xOld = x1; this.index = index; if(x1>x2) { this.x2 = x1; this.x1 = x2; this.y2 = y1; this.y1 = y2; } else { this.x1 = x1; this.x2 = x2; this.y1 = y1; this.y2 = y2; } a = y1 - y2; b = x2 - x1; c = x1*y2 - x2*y1; } public int compareTo(Usecka arg0) { return x1 - arg0.x1; } } 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(); int usecek = Integer.valueOf(s); if(usecek==0) break; List usecky = new ArrayList(); String ssOld[] = in.readLine().split(" "); for(int i=1; i=x1 && (usecka1.index-usecka2.index)>1 && (usecka1.index-usecka2.index)!=usecky.size()) { x1 = usecka2.x1; x2 = usecka2.x2; if(x<=x2 && x>=x1) { prusecik = true; break konec; } } } } if(!prusecik) System.out.println("YES"); else System.out.println("NO"); } } }