#include using namespace std; using ll = long long; struct point{ ll x, y, z; point& operator -= (const point& rhs) { x -= rhs.x, y -= rhs.y, z -= rhs.z; return *this; } friend point operator - (const point& lhs, const point& rhs) {return point(lhs) -= rhs;} friend istream& operator >> (istream& os, point& rhs) noexcept { os >> rhs.x >> rhs.y >> rhs.z; return os; } friend ll operator * (const point& lhs, const point& rhs) { return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z; } }; int main(){ ios::sync_with_stdio(false); cin.tie(0); vector a(4); for(int i = 0; i < 4; i++) cin >> a[i]; for(int i = 0; i < 3; i++){ point p1 = a[3] - a[i], p2 = a[(i + 1) % 3] - a[i], p3 = a[(i + 2) % 3] - a[i]; if(!(0 <= p1 * p2 && p1 * p2 <= p2 * p2 && 0 <= p1 * p3 && p1 * p3 <= p3 * p3)){ cout << "NO\n"; exit(0); } } cout << "YES\n"; }