#include #include #include #include #include using namespace std; int main() { int N; cin >> N; vector> points; for (auto i = N; i--; ) { int x; int y; cin >> x >> y; points.emplace_back(x, y); } sort(points.begin(), points.end(), [](pair a, pair b) { return a.first < b.first ? true : a.first > b.first ? false : a.second < b.second; }); auto deltax = points.back().first - points.front().first; auto deltay = points.back().second - points.front().second; if (deltax == 0) { auto target = points.front().first; for (auto point : points) { if (point.first != target) { cout << "NO" << endl; return 0; } cout << "YES" << endl; return 0; } } if (deltay == 0) { auto target = points.front().second; for (auto point : points) { if (point.second != target) { cout << "NO" << endl; return 0; } cout << "YES" << endl; return 0; } } double grad = deltay / deltax; double c = points.back().second - grad * points.back().first; for (auto point : points) { if (point.second != point.first * grad + c) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }