#ifndef MY_HEADER #define MY_HEADER #include #include using namespace std; using namespace atcoder; using lint = long long; using ulint = unsigned long long; using llint = __int128_t; struct edge; using graph = vector>; #define endl '\n' constexpr int INF = 1<<30; constexpr lint INF64 = 1LL<<61; constexpr lint mod107 = 1e9+7; using mint107 = modint1000000007; constexpr long mod = 998244353; using mint = modint998244353; lint ceilDiv(lint x, lint y){if(x >= 0){return (x+y-1)/y;}else{return x/y;}} lint floorDiv(lint x, lint y){if(x >= 0){return x/y;}else{return (x-y+1)/y;}} lint Sqrt(lint x) {assert(x >= 0); lint ans = sqrt(x); while(ans*ans > x)ans--; while((ans+1)*(ans+1)<=x)ans++; return ans;} lint gcd(lint a,lint b){if(a 0){int a = n%10;char b = '0' + a;string c = "";c += b;n /= 10;ans = c + ans;}}return ans;} string toString(lint n, lint k){string ans = toString(n);string tmp = "";while(ans.length() + tmp.length() < k){tmp += "0";}return tmp + ans;} vectorprime;void makePrime(lint n){prime.push_back(2);for(lint i=3;i<=n;i+=2){bool chk = true;for(lint j=0;j= 0; i--) #define vec vector #define pb push_back #define eb emplace_back #define se second #define fi first #define al(x) x.begin(),x.end() #define ral(x) x.rbegin(),x.rend() struct edge{ edge(lint v, lint c = 1) {to = v, cost = c;} lint to; lint cost; }; #endif struct Point { long long x, y; int quad; Point(long long X, long long Y) { x = X; y = Y; quad = getQuad(); } int getQuad() { if(x >= 0) { if(y >= 0) return 1; else return 4; } else { if(y >= 0) return 2; else return 3; } } }; bool operator<(const Point &left, const Point &right) { if(left.quad == right.quad) { return left.y * right.x < left.x * right.y; } else { return left.quad < right.quad; } } lint isup(lint dx1, lint dy1, lint dx2, lint dy2) { return (dy1 *dx2 < dx1 * dy2); } int main(){ lint N; cin >> N; vecX(N), Y(N); vec>P; rep(i, N) { cin >> X[i] >> Y[i]; P.pb({X[i], Y[i]}); } sort(al(P)); stack>up, down; up.push(P[0]); up.push(P[1]); down.push(P[0]); down.push(P[1]); // 上側 repp(i,2, N) { while(up.size() >= 2) { auto p1 = up.top(); up.pop(); auto p2 = up.top(); if(isup(p2.first - p1.first, p2.second - p1.second, P[i].first - p2.first, P[i].second - p2.second)) { up.push(p1); break; } } up.push(P[i]); } //下側 repp(i, 2, N) { while(down.size() >= 2) { auto p1 = down.top(); down.pop(); auto p2 = down.top(); if(isup( P[i].first - p2.first, P[i].second - p2.second, p2.first - p1.first, p2.second - p1.second)) { down.push(p1); break; } } down.push(P[i]); } if(up.size() + down.size() == N+2) cout << "Yes"; else cout << "No"; }