#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int n; cin >> n; int ox, oy,x,y; cin>>ox>>oy; cin>>x>>y; bool v = false,h = false; if(abs(ox) == abs(x)) v = true; else if(abs(oy) == abs(y)) h = true; if(!v && !h) cout<<"NO"; else { if(v) { for(int a0 = 2; a0 < n; a0++){ ox = abs(x); oy = abs(y); cin >> x >> y; if(ox != abs(x)) { v = false; break; } } if(!v) cout<<"NO"; else cout<<"YES"; } else { for(int a0 = 2; a0 < n; a0++){ ox = abs(x); oy = abs(y); cin >> x >> y; if(oy != abs(y)) { h = false; break; } } if(!h) cout<<"NO"; else cout<<"YES"; } } return 0; }