#include #include #include #include #include #include #include using namespace std; struct P { double inner(const P& p) const { double t = 0; for (int i = 0; i < 3; i++) { t += x[i] * p.x[i]; } return t; } P& operator-=(const P& p) { for (int i = 0; i < 3; i++) { x[i] -= p.x[i]; } return *this; } double x[3]; }; int main() { ios::sync_with_stdio(false); cin.tie(0); P p[4]; for (int i = 0; i < 4; i++) { cin >> p[i].x[0] >> p[i].x[1] >> p[i].x[2]; } for (int i = 0; i < 4; i++) { if (i != 2) p[i] -= p[2]; } p[2] -= p[2]; double r[2], s[2]; for (int i = 0; i < 2; i++) { double t0 = p[i].inner(p[i]); double t1 = p[i].inner(p[3]); r[i] = sqrt(t0); s[i] = t1 / r[i]; } cout << ((s[0] / r[0] + s[1] / r[1] < 1 && s[0] > 0 && s[1] > 0) ? "YES" : "NO") << endl; return 0; }