#include using namespace std; using ll = long long; using ld = double; struct Vec { ld dx; ld dy; ld dz; ld dot(const Vec& v) { return (dx * v.dx + dy * v.dy + dz * v.dz); } }; int main() { cin.tie(0); ios::sync_with_stdio(false); ld x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4; cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> x3 >> y3 >> z3 >> x4 >> y4 >> z4; Vec v1{x2 - x1, y2 - y1, z2 - z1}; Vec v2{x3 - x1, y3 - y1, z3 - z1}; Vec v3{x4 - x1, y4 - y1, z4 - z1}; const ld ab = v1.dot(v2); const ld n1 = v1.dot(v1); const ld n2 = v2.dot(v2); const ld ac = v1.dot(v3); const ld bc = v2.dot(v3); const ld x = n2 * ac - ab * bc; const ld y = -ab * ac + n1 * bc; cout << (x > 0 and y > 0 and x + y < n1 * n2 - ab * ab ? "YES" : "NO") << endl; return 0; }