#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; #define EPS 1e-8 class V2{ public: double x, y; V2(){} V2(double x_, double y_):x(x_),y(y_){} bool operator<(const V2 &p) const{ return x!=p.x?x EPS) return +1; if(cross(b, c) < -EPS) return -1; if(dot(b, c) < -EPS) return +2; if (b.dist() < c.dist()) return -2; return 0; } bool colSegSeg2(const V2 &a, const V2 &b, const V2 &c, const V2 &d){ bool res = ccw(a,b,c)*ccw(a,b,d) <= 0; res &= ccw(c,d,a)*ccw(c,d,b) <= 0; return res; } double distSegPt(const V2 &a, const V2 &b, const V2 &p){ V2 ab=b-a, ap=p-a, ba=a-b, bp=p-b; if(dot(ab, ap) < EPS) return ap.dist(); if(dot(ba, bp) < EPS) return bp.dist(); else return abs(cross(ab, ap) / ab.dist()); } const int N = 5; bool check(vector P){ auto f = [&](int i){ return V2(P[i].first, P[i].second); }; rep(i, N){ V2 a = f(i), b = f((i + 1) % N); V2 p, q, r; p = f((i + 2) % N); q = f((i + 3) % N); r = f((i + 4) % N); if(!colSegSeg2(a, b, p, q))return false; if(!colSegSeg2(a, b, q, r))return false; if(distSegPt(p, q, a) < EPS)return false; if(distSegPt(p, q, b) < EPS)return false; if(distSegPt(q, r, a) < EPS)return false; if(distSegPt(q, r, b) < EPS)return false; } return true; } int main(){ vector P(N); while(cin >> P[0].first >> P[0].second){ rep(i, N-1)cin >> P[i + 1].first >> P[i + 1].second; sort(all(P)); bool ok = false; do{ if(check(P)){ ok = true; break; } } while(next_permutation(all(P))); if(ok)cout << "YES" << endl; else cout << "NO" << endl; } }