#include #include #include #define EPS (1.0e-7) #define GT(x,y) ((x)>=(y)+EPS) #define LT(x,y) ((x)<=(y)-EPS) using namespace std; typedef complex Point; double dot(Point a, Point b){ return real(conj(a)*b); } double cross(Point a, Point b){ return imag(conj(a)*b); } int ccw(Point a, Point b, Point c){ Point d1 = b-a, d2 = c-a; if(GT(cross(d1,d2),0)) return 1; if(LT(cross(d1,d2),0)) return -1; if(LT(dot(d1,d2),0)) return -2; // b - a - c if(LT(norm(d1),norm(d2))) return 2; // a - b - c return 0; // a - c - b } Point pt[5]; void read() { for (int i = 0; i < 5; ++i) { double x, y; cin >> x >> y; pt[i] = Point(x, y); } } bool contain(Point a, Point b, Point c, Point p) { if (abs(ccw(a, b, p)) == 1 && ccw(a, b, p) == ccw(b, c, p) && ccw(b, c, p) == ccw(c, a, p)) return true; if (abs(ccw(a, b, p)) == 2 || ccw(a, b, p) == 0 || abs(ccw(b, c, p)) == 2 || ccw(b, c, p) == 0 || abs(ccw(c, a, p)) == 2 || ccw(c, a, p) == 0) return true; return false; } void work() { for (int i = 0; i < 5; ++i) for (int j = i + 1; j < 5; ++j) for (int k = j + 1; k < 5; ++k) for (int l = 0; l < 5; ++l) { if (i == l || j == l || k == l) continue; if (contain(pt[i], pt[j], pt[k], pt[l])) { cout << "NO" << endl; return; } } cout << "YES" << endl; } int main() { read(); work(); return 0; }