#!/usr/bin/env python def cross(A, B): X = A[1]*B[2] - A[2]*B[1] Y = A[2]*B[0] - A[0]*B[2] Z = A[0]*B[1] - A[1]*B[0] return [X, Y, Z] def inverse(A): det = A[0][0]*A[1][1]*A[2][2] + A[0][1]*A[1][2]*A[2][0] det += A[0][2]*A[1][0]*A[2][1] - A[0][0]*A[1][2]*A[2][1] det += - A[0][2]*A[1][1]*A[2][0] - A[0][1]*A[1][0]*A[2][2] A11 = (-1)**2 * (A[1][1]*A[2][2] - A[1][2]*A[2][1]) / det A12 = (-1)**3 * (A[1][0]*A[2][2] - A[1][2]*A[2][0]) / det A13 = (-1)**4 * (A[1][0]*A[2][1] - A[1][1]*A[2][0]) / det A21 = (-1)**3 * (A[0][1]*A[2][2] - A[0][2]*A[2][1]) / det A22 = (-1)**4 * (A[0][0]*A[2][2] - A[0][2]*A[2][0]) / det A23 = (-1)**5 * (A[0][0]*A[2][1] - A[0][1]*A[2][0]) / det A31 = (-1)**4 * (A[0][1]*A[1][2] - A[0][2]*A[1][1]) / det A32 = (-1)**5 * (A[0][0]*A[1][2] - A[0][2]*A[1][0]) / det A33 = (-1)**6 * (A[0][0]*A[1][1] - A[0][1]*A[1][0]) / det return [[A11, A21, A31], [A12, A22, A32], [A13, A23, A33]] A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] C = [int(x) for x in input().split()] D = [int(x) for x in input().split()] AB = [b - a for (a, b) in zip(A, B)] AC = [c - a for (a, c) in zip(A, C)] AD = [d - a for (a, d) in zip(A, D)] Z = cross(AB, AC) M = inverse([AB, AC, Z]) Co = [AD[0]*x + AD[1]*y + AD[2]*z for (x, y, z) in zip(M[0], M[1], M[2])] if abs(Co[0]) < 1 and abs(Co[1]) < 1: print('YES') else: print('NO')