#include<bits/stdc++.h> #define SINGLE_INPUT #define ll long long #define ull unsigned long long #define N 500005 #define MOD 998244353 usingnamespace std;
voidsol(){ int r=0, c=0, ok = 1; map<pair<int,int>, int> cnt; for (int i=0; i<4; i++) { int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; if (x1 == x2) r++; if (y1 == y2) c++; if (x1 == x2 && y1 == y2) ok = 0; cnt[{x1,y1}]++; cnt[{x2,y2}]++; } if (!ok ||r != 2 || c != 2) { cout << "NO\n"; return ; } for (auto [i,j]:cnt) { if (j != 2) { cout << "NO\n"; return ; } } cout << "YES\n"; }