#define _CRT_SECURE_NO_WARNINGS //#define _GLIBCXX_DEBUG #include using namespace std; typedef long long ll; //#define int ll //#define endl "\n" typedef vector vi; typedef vector vvi; typedef pair pii; #define all(c) (c).begin(), (c).end() #define loop(i,a,b) for(ll i=a; i ostream & operator<<(ostream & os, vector const &); template typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple const &){} template typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple const & t){ os << (n==0?"":" ") << get(t); _ot(os, t); } template ostream & operator<<(ostream & os, tuple const & t){ _ot<0>(os, t); return os; } template ostream & operator<<(ostream & os, pair const & p){ return os << "(" << p.first << ", " << p.second << ") "; } template ostream & operator<<(ostream & os, vector const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; } template inline bool chmax(T & x, T const & y){ return x inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; } #ifdef DEBUG #define dump(...) (cerr<<#__VA_ARGS__<<" = "< Polygon; enum { CCW = +1, CW = -1, BACK = +2, FRONT = -2, ON = 0 }; int ccw(PCR p0, PCR p1, PCR p2){ Point a = p1 - p0; Point b = p2 - p0; if(cross(a,b) > EPS) return CCW; if(cross(a,b) < -EPS) return CW; if(dot(a,b) < -EPS) return BACK; if(norm(a) < norm(b)) return FRONT; return ON; } Polygon andrewScan(Polygon ps){ int N = ps.size(), k = 0; sort(all(ps),comp_x); Polygon res(N*2); for(int i=0; i=2 && ccw(res[k-2], res[k-1], ps[i])!=CCW) k--; res[k++] = ps[i]; } int t = k+1; for(int i=N-2; i>=0; i--) { while(k>=t && ccw(res[k-2], res[k-1], ps[i])!=CCW) k--; res[k++] = ps[i]; } res.resize(k-1); return res; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); Polygon p(5); rep(i,5){ cin >> p[i].x >> p[i].y; } puts(andrewScan(p).size()==5 ? "YES" : "NO"); }