#include using namespace std; using pii = pair; using ll = long long; #define rep(i, j) for(int i=0; i < (int)(j); i++) #define repeat(i, j, k) for(int i = (j); i < (int)(k); i++) #define all(v) v.begin(),v.end() #define debug(x) cerr << #x << " : " << x << endl template bool set_min(T &a, const T &b) { return a > b ? a = b, true : false; } template bool set_max(T &a, const T &b) { return a < b ? a = b, true : false; } // vector template istream& operator >> (istream &is , vector &v) { for(T &a : v) is >> a; return is; } template ostream& operator << (ostream &os , const vector &v) { for(const T &t : v) os << "\t" << t; return os << endl; } // pair template ostream& operator << (ostream &os , const pair &v) { return os << "<" << v.first << ", " << v.second << ">"; } const int INF = 1 << 30; const ll INFL = 1LL << 60; using Coordinate = double; bool eq(Coordinate a, Coordinate b) { return abs(a - b) < 1e-6; } struct Point { Coordinate x,y; Point():x(0),y(0){} Point(Coordinate x,Coordinate y):x(x),y(y){} pair to_pair() const { return make_pair(x,y); } bool operator == (const Point &a) const { return eq(x, a.x) && eq(y, a.y); } bool operator != (const Point &a) const { return !(*this == a); } Point operator + (const Point& p) const { return Point(x + p.x, y + p.y); } Point operator - (const Point& p) const { return Point(x - p.x, y - p.y); } Point operator - () const { return Point(-x, -y); } Point& operator += (const Point& p) { x += p.x; y += p.y; return *this; } Point& operator -= (const Point& p) { x -= p.x; y -= p.y; return *this; } bool operator < (const Point &a) const { return x < a.x && y < a.y; } bool operator <= (const Point &a) const { return *this == a || *this < a;} bool operator > (const Point &a) const { return !(*this <= a); } bool operator >= (const Point &a) const { return !(*this < a); } }; template Point operator * (T k, const Point &p) { return Point(k * p.x, k * p.y); } double dot(const Point &a, const Point &b) { return a.x * b.x + a.y * b.y; } double cross(const Point &a, const Point &b) { return a.x * b.y - a.y * b.x; } double norm(const Point& a) { return sqrt( dot(a, a) ); } istream &operator >> (istream& is, Point& p){ return is >> p.x >> p.y;} ostream &operator << (ostream& os, Point& p){ return os << "(" << p.x << "," << p.y << ")";} double distance(const Point& a, const Point& b) { return norm(a - b); } class Solver { public: bool solve() { vector P(5); cin >> P; rep(i, 5) { int in = 0, out = 0; rep(j, 5) { if(i == j) continue; int a = 0, b = 0; Point v1 = P[j] - P[i]; rep(k, 5) { if(k == i or k == j) continue; Point v2 = P[k] - P[i]; int sign = cross(v1, v2); if(sign > 0) a++; if(sign < 0) b++; } if(a > b) swap(a, b); in += (a == 1 and b == 2); out += (b == 3); // cerr << "i, j" << i << " " << j << " a, b " << a << " " << b << endl; } if(in != 2 or out != 2) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; } }; int main() { cin.tie(0); ios::sync_with_stdio(false); Solver s; s.solve(); return 0; }