#include #include using namespace std; using namespace atcoder; //using mint = modint1000000007; //const int mod = 1000000007; using mint = modint998244353; const int mod = 998244353; //const int INF = 1e9; //const long long LINF = 1e18; const double EPS = 1e-10; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i,l,r)for(int i=(l);i<(r);++i) #define rrep(i, n) for (int i = (n) - 1; i >= 0; --i) #define rrep2(i,l,r)for(int i=(r) - 1;i>=(l);--i) #define all(x) (x).begin(),(x).end() #define allR(x) (x).rbegin(),(x).rend() #define P pair template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } tuplesegment(P p1, P p2) { long long a = p2.second - p1.second; long long b = p1.first - p2.first; long long c = p1.second * p2.first - p1.first * p2.second; long long g = gcd(a, gcd(b, c)); a /= g, b /= g, c /= g; if (a < 0) a *= -1, b *= -1, c *= -1; else if (0 == a) { if (b < 0) b *= -1, c *= -1; else if (0 == b) c = abs(c); } return { a,b,c }; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector>v(4); rep(i, 4)cin >> v[i].first >> v[i].second; sort(all(v)); { set>st; rep(i, 4)rep2(j, i + 1, 4) { auto seg = segment(v[i], v[j]); st.insert(seg); } if (st.size() != 6) { cout << "NO" << endl; return 0; } } auto dist = [&](pairs, pairt)->double { int dx = s.first - t.first; int dy = s.second - t.second; return sqrt(dx*dx + dy * dy); }; bool chk = false; do { double a = dist(v[3], v[0]); double b = dist(v[2], v[3]); double c = dist(v[1], v[2]); double d = dist(v[0], v[1]); double e = dist(v[0], v[2]); double f = dist(v[1], v[3]); double x = a * c + b * d; double y = e * f; if (abs(x - y) <= EPS) { chk = true; } } while (next_permutation(v.begin(), v.end())); cout << (chk ? "YES" : "NO") << endl; return 0; }