#include using namespace std; struct point { long double x, y, z; }; point p[3], d; inline point get_vec_ab(point pa, point pb) { point ab; ab.x = pb.x - pa.x; ab.y = pb.y - pa.y; ab.z = pb.z - pa.z; return ab; } inline long double naiseki(point pa, point pb) { return pa.x * pb.x + pa.y * pb.y + pa.z * pb.z; } int main() { for (int i = 0; i < 3; i++) { cin >> p[i].x >> p[i].y >> p[i].z; } cin >> d.x >> d.y >> d.z; bool ok = true; for (int i = 0; i < 3; i++) { point v_d = get_vec_ab(p[i], d); point v_1 = get_vec_ab(p[i], p[(i + 1) % 3]); point v_2 = get_vec_ab(p[i], p[(i + 2) % 3]); ok &= naiseki(v_d, v_1) >= 0 && naiseki(v_d, v_2) >= 0; } for (int i = 0; i < 3; i++) { point v_1 = get_vec_ab(p[i], p[(i + 1) % 3]); point v_2 = get_vec_ab(p[i], p[(i + 2) % 3]); if (naiseki(v_1, v_2) < -1e9) { ok = true; } } cout << (ok ? "YES" : "NO") << endl; }