#include #include using namespace std; class Point { public: int x, y; bool operator < (const Point& other) const; }; int cross_product(Point o, Point a, Point b) { return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x); } bool Point::operator < (const Point& other) const { return x == other.x ? y < other.y : x < other.x; } class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x _alg(vector points) { vector res; int sz = 0; for(Point p : points) { while(sz > 1 && cross_product(res[sz-2], res[sz-1], p) <= 0) { res.pop_back(); sz -= 1; } res.push_back(p); sz += 1; } return res; } vector convex_hull(vector points) { sort(points.begin(), points.end()); if(points.size() <= 1) { return points; } vector lower = _alg(points); reverse(points.begin(), points.end()); vector upper = _alg(points); vector res; for(int i : range(lower.size()-1)) { res.push_back(lower[i]); } for(int i : range(upper.size()-1)) { res.push_back(upper[i]); } return res; } int main(void) { vector points(5); for(int i : range(5)) { Point p; scanf("%d%d", &p.x, &p.y); points[i] = p; } int res = convex_hull(points).size(); puts(res == 5 ? "YES" : "NO"); return 0; }