#include using namespace std; #define D(x) cout<<#x " = "<<(x)< pii; //3_point_orientation LL triArea2(pii a, pii b, pii c) // includes sign { LL ret = 0; ret += (LL) a.xx*b.yy + (LL) b.xx*c.yy + (LL) c.xx*a.yy - (LL) a.xx*c.yy - (LL) c.xx*b.yy - (LL) b.xx*a.yy; return ret; } pii pnt[MAX+5]; set x, y; int main() { //freopen("c:\\Users\\User\\Desktop\\in.txt", "r", stdin); //freopen("c:\\Users\\User\\Desktop\\out.txt", "w", stdout); int i, j, k, n; sf(n); for(i = 1; i <= n; i++) sff(pnt[i].xx, pnt[i].yy); for(i = 1; i <= n; i++) { x.insert(pnt[i].xx); y.insert(pnt[i].yy); } if(min(x.size(), y.size()) == 1) puts("YES"); else puts("NO"); return 0; }