#include #include using namespace std; typedef long long ll; const int INF = 1<<30; const ll INFLL = 1LL<<60; const ll MOD = 998244353; const double INFD = 1.0E18; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, -1, 0, 1}; //const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; //const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; using Pair = pair; using Graph = vector>>; using mint = atcoder::modint998244353; vector> get_convex_hull(vector>& points){ sort(points.begin(), points.end()); points.erase(unique(begin(points), end(points)), end(points)); int n = points.size(); int k = 0; //size of convexfull if (n <= 2) return points; vector> ch; auto det = [&](pair p, pair q){ return p.first * q.second - q.first * p.second; }; auto sub = [&](pair p, pair q){ return make_pair(p.first - q.first, p.second - q.second); }; //反時計回り for (int i = 0; i < n; i++){ while (k > 1){ pair v_cur = sub(ch[k - 1], ch[k - 2]); pair v_new = sub(points[i], ch[k - 2]); if (det(v_cur, v_new) >= 0) break; k--; ch.pop_back(); } ch.push_back(points[i]); k++; } int t = ch.size(); for (int i = n - 2; i >= 0; i--){ while (k > t){ pair v_cur = sub(ch[k - 1], ch[k - 2]); pair v_new = sub(points[i], ch[k - 2]); if (det(v_cur, v_new) >= 0) break; k--; ch.pop_back(); } ch.push_back(points[i]); k++; } ch.resize(k - 1); return ch; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); ll n; cin >> n; vector> points(n); for (auto &[x, y] : points) cin >> x >> y; auto ch = get_convex_hull(points); cout << (ch.size() == n ? "Yes" : "No") << endl; return 0; }