#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) tuple calc(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3) { ll p1 = (x1 * x1 + y1 * y1) * (y2 - y3) + (x2 * x2 + y2 * y2) * (y3 - y1) + (x3 * x3 + y3 * y3) * (y1 - y2); ll p2 = (x1 - x2) * (y2 - y3) - (x2 * x3) * (y1 - y2); ll q1 = (x1 * x1 + y1 * y1) * (x2 - x3) + (x2 * x2 + y2 * y2) * (x3 - x1) + (x3 * x3 + y3 * y3) * (x1 - x2); ll q2 = (y1 - y2) * (x2 - x3) - (y2 * y3) * (x1 - x2); ll gp = __gcd(p1, p2), gq = __gcd(q1, q2); return {p1 / gp, p2 / gp, q1 / gq, q2 / gq}; } void solve() { vector xs(4), ys(4); rep(i, 4) cin >> xs[i] >> ys[i]; set> st; rep(i, 4) { rep(j, 3) { ll i0 = (i + j) % 4; ll i1 = (i + j + 1) % 4; ll i2 = (i + j + 2) % 4; st.insert(calc(xs[i0], ys[i0], xs[i1], ys[i1], xs[i2], ys[i2])); } } cout << (st.size() == 1 ? "YES" : "NO") << '\n'; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }