#include #define VARNAME(x) #x #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using ld = long double; template ostream& operator<<(ostream& os, const vector& v) { os << "sz:" << v.size() << "\n["; for (const auto& p : v) { os << p << ","; } os << "]\n"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } constexpr ll MOD = (ll)1e9 + 7LL; constexpr ld PI = static_cast(3.1415926535898); template constexpr T INF = numeric_limits::max() / 10; struct Vec { ll dx; ll dy; ll dz; ll dot(const Vec& v) { return (dx * v.dx + dy * v.dy + dz * v.dz); } }; int main() { cin.tie(0); ios::sync_with_stdio(false); ll 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 ll ab = v1.dot(v2); const ll n1 = v1.dot(v1); const ll n2 = v2.dot(v2); const ll ac = v1.dot(v3); const ll bc = v2.dot(v3); const ll x = n2 * ac - ab * bc; const ll y = -ab * ac + n1 * bc; cout << (x + y < n1 * n2 - ab * ab ? "YES" : "NO") << endl; return 0; }