#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 calSlope(int x1,int y1,int x2,int y2){ if (x1-x2 == 0) return 0; //verticle else if (y1-y2 == 0) return 1; //h else return -1; } int main(){ int n; cin >> n; int slope; int points[10][2]; for(int a0 = 0; a0 < n; a0++){ int x; int y; cin >> x >> y; points[a0][0] = x; points[a0][1] = y; } slope = calSlope(points[0][0],points[0][1],points[1][0],points[1][1]); bool success; for(int a0 = 1; a0 < n; a0++){ int slopeT = calSlope(points[0][0],points[0][1],points[a0][0],points[a0][1]); if(slope >= 0 && slope != slopeT){ success = false; break; } else if (slope >= 0 && slope == slopeT) success = true; else{ success = false; break; } } if(success) cout << "YES"; else cout << "NO"; return 0; }