#include using namespace std; const int N = 11; int n, x[N], y[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 1; i <= n; i++) cin >> x[i] >> y[i]; int X = x[1], Y = y[1]; //cout << X << ' ' << Y << endl; bool xx = 1, yy = 1; for (int i = 1; i <= n; i++) if (x[i] != X) xx = 0; for (int i = 1; i <= n; i++) if (y[i] != Y) yy = 0; if (xx || yy) cout << "YES" << endl; else cout << "NO" << endl; }