#include using namespace std; typedef unsigned short usint; typedef unsigned uint; typedef unsigned long ulint; typedef unsigned long long ullint; typedef long long llint; #define mp make_pair int main() { ios_base::sync_with_stdio(0); int n; cin >> n; vector > vp; int x, y; for (int t1 = 0; t1 < n; ++t1) { cin >> x >> y; vp.push_back(mp(x, y)); } sort(vp.begin(), vp.end()); bool hor = true; bool ver = true; for (int t1 = 1; t1 < n; ++t1) { if (vp[t1].first != vp[t1-1].first) ver = false; if (vp[t1].second != vp[t1-1].second) hor = false; } if (hor+ver) cout << "YES\n"; else cout << "NO\n"; return 0; }