#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 struct Point{ int x, y; Point(){}; Point(int x, int y):x(x), y(y){}; bool operator <(const Point &p) const { return x < p.x || (x == p.x && y < p.y); } bool operator ==(const Point &p) const { return (x == p.x && y == p.y); } }; long long cross(const Point &O, const Point &A, const Point &B){ return (long long)(A.x - O.x) * (B.y - O.y) - (long long)(A.y - O.y) * (B.x - O.x); } vector convex_hull(vector P){ int chn = P.size(); int chk = 0; vector H(2*chn); sort(P.begin(), P.end()); for(int i = 0; i < chn; i++){ while(chk >= 2 && cross(H[chk-2], H[chk-1], P[i]) <= 0)chk--; H[chk++] = P[i]; } for(int i = chn-2, t = chk+1; i >= 0; i--){ while(chk >= t && cross(H[chk-2], H[chk-1], P[i]) <= 0)chk--; H[chk++] = P[i]; } H.resize(chk); return H; } int main(){ vector vp; rep(i,0,5){ int x,y; cin>>x>>y; vp.pb(Point(x,y)); } vector vp1 = convex_hull(vp); if(vp1.sz==6){ cout << "YES" << endl; } else{ cout << "NO" << endl; } return 0; } /* 星が描けるということは点を繋いで凸五角形であれば良いのと同じ。 凸包を使うと簡単な問題。凸包の学習用の問題です。 */