def cp(AB, AC): return [AB[1] * AC[2] - AB[2] * AC[1], AB[2] * AC[0] - AB[0] * AC[2], AB[0] * AC[1] - AB[1] * AC[0]] def dp(A, B): return sum([A[i] * B[i] for i in range(0,3)]) def solve(A, B, C, D): AB = [B[i] - A[i] for i in range(0,3)] AC = [C[i] - A[i] for i in range(0,3)] N = cp(AB, AC) d = -(sum(N[i] * A[i] for i in range(0,3))) k = (sum(N[i] * D[i] for i in range(0,3))) / (sum(N[i] * N[i] for i in range(0,3))) H = [k * N[i] for i in range(0,3)] AB = [B[i] - A[i] for i in range(0,3)] BH = [H[i] - B[i] for i in range(0,3)] BC = [C[i] - B[i] for i in range(0,3)] CH = [H[i] - C[i] for i in range(0,3)] CA = [A[i] - C[i] for i in range(0,3)] AH = [H[i] - A[i] for i in range(0,3)] c1 = cp(CA, AH) c2 = cp(AB, BH) c3 = cp(BC, CH) a = dp(c1, c2) b = dp(c1, c3) return True if (a * b > 0) else False if __name__ == '__main__': A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) D = list(map(int, input().split())) print("YES" if solve(A, B, C, D) else "NO")