#include #define int long long using namespace std; struct Point { int x, y, z; Point() {} Point(int x, int y, int z) { this->x = x; this->y = y; this->z = z; } static int dot(Point l, Point r) { return l.x * r.x + l.y * r.y + l.z * r.z; } }; Point operator-(const Point l, const Point r) { return Point(l.x - r.x, l.y - r.y, l.z - r.z); } Point p[4]; signed main() { int i; for (i = 0; i < 4; i++) cin >> p[i].x >> p[i].y >> p[i].z; int a = Point::dot(p[1] - p[0], p[3] - p[0]); int b = Point::dot(p[2] - p[1], p[3] - p[1]); int c = Point::dot(p[0] - p[2], p[3] - p[2]); if (a >= 0 && b >= 0 && c >= 0) cout << "YES" << endl; else cout << "NO" << endl; return 0; }