#include // #include // #include using namespace std; // using namespace atcoder; // using bint = boost::multiprecision::cpp_int; using ll = long long; using ull = unsigned long long; using ld = long double; using P = pair; using vi = vector; using vvi = vector; using vvvi = vector; using ve = vector>; using vb = vector; using vvb = vector; #define rep(i,s,n) for(ll i = (ll)s;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define sz(c) ((ll)(c).size()) #define LB(A,x) (int)(lower_bound(A.begin(),A.end(),x)-A.begin()) #define UB(A,x) (int)(upper_bound(A.begin(),A.end(),x)-A.begin()) // #define MOD 1000000007 #define MOD 998244353 templateusing min_priority_queue=priority_queue,greater>; templateostream&operator<<(ostream&os,vector&v){for(int i = 0;i < v.size();i++)os<istream&operator>>(istream&is,vector&v){for(T&in:v)is>>in;return is;} templateostream&operator<<(ostream&os,pair&p){os<istream&operator>>(istream&is,pair&p){is>>p.first>>p.second;return is;} template inline bool chmax(T &a,T b){if(a < b){a = b;return true;}return false;} template inline bool chmin(T &a,T b){if(a > b){a = b;return true;}return false;} // ld dist(ld x1,ld y1,ld x2, ld y2){return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));} const double eps = 1e-10; using Point = complex; #define eq(a,b) (abs((a)-(b)) < eps) using T = ld; istream &operator>>(istream &is,Point &p) { T a, b; is >> a >> b; p = Point(a, b); return is; } ostream &operator<<(ostream &os, Point &p) { return os << fixed << setprecision(10) << p.real() << " " << p.imag(); } namespace std{ bool operator<(const Point &a,const Point &b){ return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); } } ld dist(Point a,Point b){return abs(a-b);} T det(Point a,Point b){return a.real()*b.imag()-a.imag()*b.real();} bool is_point_on_l(Point a,Point a_,Point c){return eq(det(a-a_,c-a_),0.0);} int main(){ ios_base::sync_with_stdio(0), cin.tie(0); Point A[4]; rep(i,0,4)cin >> A[i]; vi p(4);iota(ALL(p),0); { Point a = A[p[0]]; Point b = A[p[1]]; Point c = A[p[2]]; Point d = A[p[3]]; if(is_point_on_l(a,b,c) && is_point_on_l(a,b,d)){ cout << "NO\n"; return 0; } } do{ Point a = A[p[0]]; Point b = A[p[1]]; Point c = A[p[2]]; Point d = A[p[3]]; ld k = dist(a,c)*dist(b,d); ld l = dist(a,d)*dist(b,c) + dist(a,b)*dist(d,c); if(eq(k,l)){ cout << "YES\n"; return 0; } }while(next_permutation(ALL(p))); cout << "NO\n"; // cout << (eq(k,l) ? "YES\n" : "NO\n"); // cout << fixed << setprecision(10); // cout << k << " k\n"; // cout << l << " l\n"; return 0; }