#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rev(i,n) for(int i=(n)-1;(i)>=0;(i)--) #define all(a) (a).begin(),(a).end() #define pb(a) push_back(a) #define bitcount(b) __builtin_popcount(b) template vector& operator<<(vector& a, S b) { a.push_back(b); return a; } template void operator>>(vector& a, int b) {while(b--)if(!a.empty())a.pop_back();} bool isprime(int n){ if(n<2)return false; for(int i=2;i*i<=n;i++)if(n%i==0)return false; return true;} const double EPS = 1e-8; const double INF = 1e12; typedef complex P; namespace std { bool operator < (const P& a, const P& b) { if( abs(a-b) < EPS ) return false; return abs(real(a)-real(b))>EPS ? real(a) < real(b) : imag(a) < imag(b); } } double cross(const P& a, const P& b) { return imag(conj(a)*b); } double dot(const P& a, const P& b) { return real(conj(a)*b); } struct L : public vector

{ L(){} L(const P &a, const P &b) { push_back(a); push_back(b); } }; int ccw(P a, P b, P c) { b -= a; c -= a; if (cross(b, c) > 0) return +1; // counter clockwise if (cross(b, c) < 0) return -1; // clockwise if (dot(b, c) < 0) return +2; // c--a--b on line if (norm(b) < norm(c)) return -2; // a--b--c on line return 0; } typedef vector

G; bool intersectSS(const L &s, const L &t) { return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 && ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0; } P crosspoint(const L &l, const L &m) { double A = cross(l[1] - l[0], m[1] - m[0]); double B = cross(l[1] - l[0], l[1] - m[0]); if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!! return m[0] + B / A * (m[1] - m[0]); } bool reallyIntersect(const L &s, const L &t) { if( intersectSS(s,t) == false ) return false; P cp = crosspoint(s,t); for(int i = 0 ; i < 2 ; i++){ if( abs(cp-s[i]) <= EPS ) return false; if( abs(cp-t[i]) <= EPS ) return false; } return true; } int main(){ P p[5]; for(int i = 0 ; i < 5 ; i++){ double x,y; cin >> x >> y; p[i] = P(x,y); } sort(p,p+5); do{ L l[10]; for(int i = 0 ; i < 10 ; i++) l[i] = L(p[i%5],p[(i+1)%5]); int f = -1; for(int i = 0 ; i < 5 ; i++){ if( reallyIntersect(l[i],l[i+1]) == false ){} else { f = 0; } if( reallyIntersect(l[i],l[i+2]) == true ){ } else { f = 1; } if( reallyIntersect(l[i],l[i+3]) == true ){} else { f = 2; } if( reallyIntersect(l[i],l[i+4]) == false ){} else { f = 3; } } if( f == -1 ){ //cout << p[0] << "->" << p[1] << "->" << p[2] << "->" << p[3] << "->" << p[4] << endl; cout << "YES" << endl; return 0; } }while(next_permutation(p,p+5)); cout << "NO" << endl; }