#include #include using namespace std; using namespace atcoder; #define rep(i, n) for(int i=0;i<(n);++i) #define rep1(i, n) for(int i=1;i<=(n);i++) #define ll long long using mint = modint998244353; using P = pair; using lb = long double; using T = tuple; #ifdef LOCAL # include # define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else # define dbg(...) (static_cast(0)) #endif int main() { vector> pos(4); rep(i,4) cin >> pos[i].first >> pos[i].second; auto dist = [&](int i, int j) -> ll { return (pos[i].first-pos[j].first)*(pos[i].first-pos[j].first)+(pos[i].second-pos[j].second)*(pos[i].second-pos[j].second); }; vector vs(4); rep(i,4) vs[i] = i; vector> vec(3); rep(i,3) vec[i] = make_pair(pos[i+1].first-pos[0].first,pos[i+1].second-pos[0].second); if(vec[1].first*vec[0].second-vec[1].second*vec[0].first==0 && vec[2].first*vec[0].second-vec[2].second*vec[0].first==0){ cout << "NO" << endl; return 0; } do{ ll ab = dist(vs[0],vs[1]); ll ac = dist(vs[0],vs[2]); ll ad = dist(vs[0],vs[3]); ll bc = dist(vs[1],vs[2]); ll bd = dist(vs[1],vs[3]); ll cd = dist(vs[2],vs[3]); ll v1 = ac*bd-ab*cd-ad*bc; ll v2 = 4*ad*bc*ab*cd; dbg(v1*v1,v2); if(v1*v1==v2) { cout << "YES" << endl; return 0; } } while(next_permutation(vs.begin(),vs.end())); cout << "NO" << endl; return 0; }