#include using namespace std; int main() { int n; cin >> n; int x0, y0, x1, y1; cin >> x0 >> y0 >> x1 >> y1; bool vert = (x0 == x1), hor = (y0 == y1); for (int i = 0; i < n - 2 && (vert || hor); i++) { int x; int y; cin >> x >> y; vert = vert && x == x0; hor = hor && y == y0; } cout << (vert || hor ? "YES" : "NO") << endl; }