import java.util.ArrayList; import java.util.Scanner; public class Main { static boolean cul(int[] x,int []y, ArrayList use,ArrayList not){ int one = (x[use.get(1)]-x[use.get(0)])*(y[not.get(0)]-y[use.get(0)])-(y[use.get(1)]-y[use.get(0)])*(x[not.get(0)]-x[use.get(0)]); int two = (x[use.get(2)]-x[use.get(1)])*(y[not.get(0)]-y[use.get(1)])-(y[use.get(2)]-y[use.get(1)])*(x[not.get(0)]-x[use.get(1)]); int three=(x[use.get(0)]-x[use.get(2)])*(y[not.get(0)]-y[use.get(2)])-(y[use.get(0)]-y[use.get(2)])*(x[not.get(0)]-x[use.get(2)]); if((one>0 && two >0 && three >0 )||(one<0 && two <0 && three <0) || one==0 || two ==0 || three==0){ return false; }else{ } one = (x[use.get(1)]-x[use.get(0)])*(y[not.get(1)]-y[use.get(0)])-(y[use.get(1)]-y[use.get(0)])*(x[not.get(1)]-x[use.get(0)]); two = (x[use.get(2)]-x[use.get(1)])*(y[not.get(1)]-y[use.get(1)])-(y[use.get(2)]-y[use.get(1)])*(x[not.get(1)]-x[use.get(1)]); three=(x[use.get(0)]-x[use.get(2)])*(y[not.get(1)]-y[use.get(2)])-(y[use.get(0)]-y[use.get(2)])*(x[not.get(1)]-x[use.get(2)]); if((one>0 && two >0 && three >0 )||(one<0 && two <0 && three <0) || one==0 || two ==0 || three==0){ return false; }else{ } return true; } public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int[] x = new int[5]; int[] y = new int[5]; for(int i=0;i<5;i++){ x[i]=sc.nextInt(); y[i]=sc.nextInt(); } for(int i=0; i< (1<<5);i++){ if(Integer.bitCount(i)!=3) continue; ArrayList use = new ArrayList<>(); ArrayList not = new ArrayList<>(); for(int j=0;j<5;j++){ if((i >> j &1) >0){ use.add(j); }else{ not.add(j); } } if(!cul(x, y, use, not)){ System.out.println("NO"); return; } } System.out.println("YES"); } }