#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, double *, double *, double *, double *, double *,
                 double *, double *, double *);
int main(void) {
  double x1, y1, x2, y2, x3, y3, xp, yp, k, l;
  while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3,
               &y3, &xp, &yp) != EOF) {
    k = ((xp - x1) * (y3 - y1) - (yp - y1) * (x3 - x1)) /
        ((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1));
    l = ((yp - y1) * (x2 - x1) - (xp - x1) * (y2 - y1)) /
        ((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1));
    if (k > 0.0 && l > 0.0 && k + l < 1.0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
lea    -0x38(%rbp),%r11
lea    -0x40(%rbp),%r10
lea    -0x48(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <scanf@plt>
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
je     1319 <main+0x1f9>
movsd  -0x40(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm4
subsd  -0x18(%rbp),%xmm4
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm4
subsd  -0x18(%rbp),%xmm4
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1308 <main+0x1e8>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1308 <main+0x1e8>
movsd  -0x50(%rbp),%xmm1
addsd  -0x58(%rbp),%xmm1
movsd  0xd13(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1308 <main+0x1e8>
lea    0xd2b(%rip),%rdi
call   1030 <printf@plt>
jmp    1314 <main+0x1f4>
lea    0xd1f(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
lea    0x18(%rsp),%rbp
lea    0x20(%rsp),%rbx
lea    0xec0(%rip),%rdi
lea    0x48(%rsp),%rsi
lea    0x40(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x30(%rsp),%r8
lea    0x28(%rsp),%r9
push   %rax
push   %rbp
push   %rbx
call   1040 <scanf@plt>
add    $0x20,%rsp
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%rax
jne    118a <main+0x6a>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe98(%rip),%r14
xorpd  %xmm5,%xmm5
lea    0x40(%rsp),%r15
lea    0x38(%rsp),%r12
lea    0x30(%rsp),%r13
lea    0x28(%rsp),%rbx
lea    0x20(%rsp),%rbp
jmp    11fe <main+0xde>
call   1030 <puts@plt>
sub    $0x8,%rsp
lea    0xe48(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
lea    0x10(%rsp),%rax
push   %rax
lea    0x20(%rsp),%rax
push   %rax
lea    0x30(%rsp),%rax
push   %rax
call   1040 <scanf@plt>
add    $0x20,%rsp
mov    0x2df7(%rip),%rcx
cmp    (%rcx),%rax
xorpd  %xmm5,%xmm5
je     1179 <main+0x59>
movsd  0x10(%rsp),%xmm1
movhpd 0x8(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
movsd  0x40(%rsp),%xmm3
movapd %xmm3,%xmm4
unpcklpd %xmm2,%xmm4
subpd  %xmm4,%xmm1
movsd  0x18(%rsp),%xmm0
movhpd 0x30(%rsp),%xmm0
unpcklpd %xmm3,%xmm2
subpd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm2
movhpd 0x28(%rsp),%xmm2
subpd  %xmm4,%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm0,%xmm4
unpckhpd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm3,%xmm4
mulpd  %xmm1,%xmm0
shufpd $0x1,%xmm1,%xmm1
mulpd  %xmm2,%xmm1
subpd  %xmm1,%xmm0
unpcklpd %xmm4,%xmm4
divpd  %xmm4,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xd6d(%rip),%xmm3
ucomisd %xmm2,%xmm3
lea    0xd8e(%rip),%rdi
jbe    12c0 <main+0x1a0>
ucomisd %xmm5,%xmm1
jbe    12c9 <main+0x1a9>
ucomisd %xmm5,%xmm0
ja     11b0 <main+0x90>
jmp    12d6 <main+0x1b6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
ucomisd %xmm5,%xmm1
ja     12a6 <main+0x186>
mov    %r14,%rdi
ucomisd %xmm5,%xmm0
ja     11b0 <main+0x90>
mov    %r14,%rdi
jmp    11b0 <main+0x90>

LLVM IR (-O0):
@.str = [33 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\0A\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"YES\0A\00"
@.str.2 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
br label %12
12: ; preds = %93, %0
%13 = call i64 @scanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %94
16: ; preds = %12
%17 = load double, double* %8
%18 = load double, double* %2
%19 = fsub double %17, %18
%20 = load double, double* %7
%21 = load double, double* %3
%22 = fsub double %20, %21
%23 = load double, double* %9
%24 = load double, double* %3
%25 = fsub double %23, %24
%26 = load double, double* %6
%27 = load double, double* %2
%28 = fsub double %26, %27
%29 = fmul double %25, %28
%30 = fneg double %29
%31 = call double @llvm.fmuladd.f64(double %19, double %22, double %30)
%32 = load double, double* %4
%33 = load double, double* %2
%34 = fsub double %32, %33
%35 = load double, double* %7
%36 = load double, double* %3
%37 = fsub double %35, %36
%38 = load double, double* %6
%39 = load double, double* %2
%40 = fsub double %38, %39
%41 = load double, double* %5
%42 = load double, double* %3
%43 = fsub double %41, %42
%44 = fmul double %40, %43
%45 = fneg double %44
%46 = call double @llvm.fmuladd.f64(double %34, double %37, double %45)
%47 = fdiv double %31, %46
store double %47, double* %10
%48 = load double, double* %9
%49 = load double, double* %3
%50 = fsub double %48, %49
%51 = load double, double* %4
%52 = load double, double* %2
%53 = fsub double %51, %52
%54 = load double, double* %8
%55 = load double, double* %2
%56 = fsub double %54, %55
%57 = load double, double* %5
%58 = load double, double* %3
%59 = fsub double %57, %58
%60 = fmul double %56, %59
%61 = fneg double %60
%62 = call double @llvm.fmuladd.f64(double %50, double %53, double %61)
%63 = load double, double* %4
%64 = load double, double* %2
%65 = fsub double %63, %64
%66 = load double, double* %7
%67 = load double, double* %3
%68 = fsub double %66, %67
%69 = load double, double* %6
%70 = load double, double* %2
%71 = fsub double %69, %70
%72 = load double, double* %5
%73 = load double, double* %3
%74 = fsub double %72, %73
%75 = fmul double %71, %74
%76 = fneg double %75
%77 = call double @llvm.fmuladd.f64(double %65, double %68, double %76)
%78 = fdiv double %62, %77
store double %78, double* %11
%79 = load double, double* %10
%80 = fcmp ogt double %79, 0.000000e+00
br i1 %80, label %81, label %91
81: ; preds = %16
%82 = load double, double* %11
%83 = fcmp ogt double %82, 0.000000e+00
br i1 %83, label %84, label %91
84: ; preds = %81
%85 = load double, double* %10
%86 = load double, double* %11
%87 = fadd double %85, %86
%88 = fcmp olt double %87, 1.000000e+00
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %93
91: ; preds = %84, %81, %16
%92 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %93
93: ; preds = %91, %89
br label %12
94: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\0A\00"
@EOF = global i64 0
@str = [3 x i8] c"NO\00"
@str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %1 to i8*
%10 = bitcast double* %2 to i8*
%11 = bitcast double* %3 to i8*
%12 = bitcast double* %4 to i8*
%13 = bitcast double* %5 to i8*
%14 = bitcast double* %6 to i8*
%15 = bitcast double* %7 to i8*
%16 = bitcast double* %8 to i8*
%17 = call i64 @scanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %69, label %20
20: ; preds = %0, %20
%21 = load double, double* %7
%22 = load double, double* %1
%23 = load double, double* %6
%24 = load double, double* %2
%25 = load double, double* %8
%26 = insertelement <2 x double> poison, double %21, i64 0
%27 = insertelement <2 x double> %26, double %25, i64 1
%28 = insertelement <2 x double> poison, double %22, i64 0
%29 = insertelement <2 x double> %28, double %24, i64 1
%30 = fsub <2 x double> %27, %29
%31 = load double, double* %5
%32 = load double, double* %3
%33 = insertelement <2 x double> poison, double %23, i64 0
%34 = insertelement <2 x double> %33, double %32, i64 1
%35 = insertelement <2 x double> poison, double %24, i64 0
%36 = insertelement <2 x double> %35, double %22, i64 1
%37 = fsub <2 x double> %34, %36
%38 = load double, double* %4
%39 = insertelement <2 x double> poison, double %31, i64 0
%40 = insertelement <2 x double> %39, double %38, i64 1
%41 = fsub <2 x double> %40, %29
%42 = extractelement <2 x double> %41, i64 0
%43 = fneg double %42
%44 = extractelement <2 x double> %41, i64 1
%45 = fmul double %44, %43
%46 = extractelement <2 x double> %37, i64 0
%47 = extractelement <2 x double> %37, i64 1
%48 = call double @llvm.fmuladd.f64(double %47, double %46, double %45)
%49 = shufflevector <2 x double> %30, <2 x double> undef, <2 x i32> <i32 1, i32 0>
%50 = fneg <2 x double> %49
%51 = fmul <2 x double> %41, %50
%52 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %30, <2 x double> %37, <2 x double> %51)
%53 = insertelement <2 x double> poison, double %48, i64 0
%54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> zeroinitializer
%55 = fdiv <2 x double> %52, %54
%56 = extractelement <2 x double> %55, i64 0
%57 = fcmp ogt double %56, 0.000000e+00
%58 = extractelement <2 x double> %55, i64 1
%59 = fcmp ogt double %58, 0.000000e+00
%60 = select i1 %57, i1 %59, i1 false
%61 = fadd double %56, %58
%62 = fcmp olt double %61, 1.000000e+00
%63 = select i1 %60, i1 %62, i1 false
%64 = select i1 %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%65 = call i32 @puts(i8* dereferenceable(1) %64)
%66 = call i64 @scanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8)
%67 = load i64, i64* @EOF
%68 = icmp eq i64 %66, %67
br i1 %68, label %69, label %20
69: ; preds = %20, %0
ret i32 0
}