Problem:
Problem F
Villa of Emblem Shape
The princess has a vast private estate.
She has decided to build a new villa there.
According to her creative request, the ground floor outline of the main house of the villa must be derived from the emblem of the royal family.
The emblem is a simple polygon.
Four examples are shown in Figure F-1.
The outline does not have to be the exact shape of the emblem; it can be formed by sliding and overlaying multiple copies of the emblem, like in Figure F-2.
Any finite number of copies can be used, but all the copies should have the same size and orientation without being reversed.
Dataset 1
Dataset 2
Dataset 3
Dataset 4
Figure F-1: The emblems in Sample Input
Figure F-2: An example of overlaying of copies for the first dataset of Sample Input
For security reasons, the outline must be a convex polygon.
The rightmost of Figure F-2 is a convex polygon.
Your task is to judge whether a convex polygon can be constructed by overlaying a finite number of copies of the emblem.
Input
The input consists of multiple datasets, each in the following format.
n
x
1
y
1
⋮
x
n
y
n
n
is the number of the vertices of the emblem, an integer between 3 and 200, inclusive.
(
x
i
, y
i
) gives the coordinates of the
i
-th vertex in the right-hand coordinate system (
i
= 1,
..., n
).
Each of
x
i
and
y
i
is an integer between −10000 and 10000, inclusive.
Any two vertices have different coordinates.
The vertices are listed in a counterclockwise order.
Any two edges of the emblem do not have a common point other than their connecting vertex.
For each vertex, the angle of the two edges is not 180 degrees.
The end of the input is indicated by a line consisting of a zero. The input consists of at most 500 datasets.
Output
For each dataset, output in a line
Yes
if a convex polygon can be constructed, and
No
, otherwise.
Sample Input
12
-5 -7
5 -7
5 -3
1 -3
1 3
5 3
5 7
-5 7
-5 3
-1 3
-1 -3
-5 -3
7
0 0
7 1
3 2
2 4
6 9
4 10
1 7
14
0 1
2 0
3 1
2 4
0 4
1 2
-1 1
0 3
-1 4
-2 4
-3 3
-2 -3
-1 -3
0 -2
5
-2 0
1 -4
2 -3
2 3
1 4
0
Output for the Sample Input
Yes
No
Yes
Yes

Submitted solutions:

code_snippet: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
typedef long long ll;
typedef double ld;
inline int sign(const ll& x) { return x < 0 ? -1 : !!x; }

int N;
struct Pos {
	int x, y, i;
	Pos(int x_ = 0, int y_ = 0, int i_ = -1) : x(x_), y(y_), i(i_) {}
	bool operator == (const Pos& p) const { return x == p.x && y == p.y; }
	bool operator < (const Pos& p) const { return x == p.x ? y < p.y : x < p.x; }
	Pos operator - (const Pos& p) const { return { x - p.x, y - p.y }; }
	ll operator / (const Pos& p) const { return (ll)x * p.y - (ll)y * p.x; }
	ll Euc() const { return (ll)x * x + (ll)y * y; }
	friend std::istream& operator >> (std::istream& is, Pos& p) { is >> p.x >> p.y; return is; }
	friend std::ostream& operator << (std::ostream& os, const Pos& p) { os << p.x << " " << p.y; return os; }
}; const Pos O = Pos(0, 0);
typedef std::vector<Pos> Polygon;
ll cross(const Pos& d1, const Pos& d2, const Pos& d3) { return (d2 - d1) / (d3 - d2); }
int ccw(const Pos& d1, const Pos& d2, const Pos& d3) { return sign(cross(d1, d2, d3)); }
Polygon graham_scan(Polygon C) {
	Polygon H;
	if (C.size() < 3) {
		std::sort(C.begin(), C.end());
		return C;
	}
	std::swap(C[0], *min_element(C.begin(), C.end()));
	std::sort(C.begin() + 1, C.end(), [&](const Pos& p, const Pos& q) -> bool {
		int ret = ccw(C[0], p, q);
		if (!ret) return (C[0] - p).Euc() < (C[0] - q).Euc();
		return ret > 0;
		}
	);
	C.erase(unique(C.begin(), C.end()), C.end());
	int sz = C.size();
	for (int i = 0; i < sz; i++) {
		while (H.size() >= 2 && ccw(H[H.size() - 2], H.back(), C[i]) <= 0)
			H.pop_back();
		H.push_back(C[i]);
	}
	return H;
}
void solve() {
	std::cin.tie(0)->sync_with_stdio(0);
	std::cout.tie(0);
	std::cout << std::fixed;
	std::cout.precision(9);
	while (1) {
		std::cin >> N;
		if (!N) break;
		Polygon P(N);
		for (int i = 0; i < N; i++) std::cin >> P[i], P[i].i = i;
		Polygon H = graham_scan(P);
		int sz = H.size();
		bool f = 1;
		for (int i = 0, s, e; i < sz; i++) {
			s = H[i].i, e = H[(i + 1) % sz].i;
			if ((s + 1) % N == e) continue;
			if (ccw(P[s], P[e], P[(s + 1) % N])) { f = 0; break; }
			if (ccw(P[s], P[e], P[(e - 1 + N) % N])) { f = 0; break; }
		}
		std::cout << (f ? "Yes\n" : "No\n");
	}
	return;
}
int main() { solve(); return 0; }
accuracy: 1
time_ms: 10
memory_kb: 3436
final_rank: 2

code_snippet: #include "bits/stdc++.h"
using namespace std;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INFll (ll)1ll << 60 
#define MINFll (-1 * INFll)
#define ALL(n) n.begin(), n.end()
#define MOD (ll)998244353
#define P pair<ll, ll>

//ok -> verified
using Real = double;
using Pt = complex<Real>;
const Real EPS = 1e-8;

int sgn(Real a){//ok
    return (a < -EPS) ? -1 : (a > EPS) ? 1 : 0;
}
inline Pt operator*= (const Pt &a, const Real &b){
    return Pt(real(a) * b, imag(a) * b);
}

inline Pt operator* (const Pt &a, const Real &b){
    return a *= b;
}

namespace std {
    bool operator<(const Pt &a, const Pt &b){
        return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
    }
}

istream &operator>> (istream &is, Pt &p){//ok
    Real a, b;
    is >> a >> b;
    p = Pt(a, b);
    return is;
}

Real dot(const Pt &a, const Pt &b) {//ok
    return real(a) * real(b) + imag(a) * imag(b);
}

Real cross(const Pt &a, const Pt &b){//ok
    return real(a) * imag(b) - real(b) * imag(a);
}

Real arg(const Pt &a){
    return atan2(imag(a), real(a));
}

int ccw(const Pt &a, const Pt &b, const Pt &c){//ok
    if (cross(b - a, c - a) > EPS) return 1; //CCW
    if (cross(b - a, c - a) < -EPS) return -1; //CW
    if (dot(a - b, c - b) < -EPS) return 2; //a-b-c
    if (dot(b - a, c - a) < -EPS) return -2; //c-a-b
    return 0; //a-c-b(on seg)
}

struct Line{//ok
    Pt a, b;
    Line(Pt a, Pt b) : a(a), b(b){};
};

struct Segment : Line{
    Segment(Pt a, Pt b) : Line(a, b){};
};

struct Circle{//ok
    Pt a;
    Real r;
    Circle(Pt a, Real r) : a(a), r(r){};
};

using Polygon = vector<Pt>;

Pt projection(const Line &a, const Pt &p){//ok
    Real t = dot(p - a.a, a.a - a.b) / norm(a.a - a.b);
    return a.a + (a.a - a.b) * t;
}

Pt projection(const Segment &a, const Pt &p){//ok
    Real t = dot(p - a.a, a.a - a.b) / norm(a.a - a.b);
    return a.a + (a.a - a.b) * t;
}

Pt reflection(const Line &a, const Pt &b){//ok
    return b + (projection(a, b) - b) * 2.0;
}

Pt reflection(const Segment &a, const Pt &b){//ok
    return b + (projection(a, b) - b) * 2.0;
}

//平行
bool parallel(const Line &a, const Line &b){
    return !sgn(cross(a.b - a.a, b.b - b.a));
}

//直角
bool orthogonal(const Line &a, const Line &b){
    return !sgn(dot(a.a - a.b, b.a - b.b));
}

bool intersect(const Line &a, const Pt &b){
    return abs(ccw(a.a, a.b, b)) != 1;
}

bool intersect(const Line &a, const Line &b){
    return !parallel(a, b);
}

bool intersect(const Line &a, const Segment &b){
    return cross(a.b - a.a, b.a - a.a) * cross(a.b - a.a, b.b - a.a) < EPS;
}

bool intersect(const Segment &a, const Pt &b){//ok
    return ccw(a.a, a.b, b) == 0;
}

bool intersect(const Segment &a, const Segment &b){//ok
    return (sgn(ccw(a.a, a.b, b.a) * ccw(a.a, a.b, b.b)) <= 0 and
    sgn(ccw(b.a, b.b, a.a) * ccw(b.a, b.b, a.b)) <= 0);
}

Real distance(const Line &a, const Pt &b);

bool intersect(const Circle &a, const Pt &b){
    return sgn(abs(a.a - b) - a.r) == 0;
}

bool intersect(const Circle &a, const Line &b){
    return sgn(distance(b, a.a) - a.r) == -1;
}

int intersect(const Circle &a, const Segment &b){
    if (norm(projection(b, a.a) - a.a) - a.r * a.r > EPS) return 0;
    auto d1 = abs(a.a - b.a), d2 = abs(a.a - b.b);
    if (d1 < a.r + EPS and d2 < a.r + EPS) return 0;
    if (d1 < a.r - EPS and d2 > a.r + EPS or d1 > a.r + EPS and d2 < a.r - EPS) return 1;
    const Pt j = projection(b, a.a);
    if (dot(b.a - j, b.b - j) < 0) return 2;
    return 0;
}

int intersect(Circle a, Circle b){ //共通接線の数 ok
    if (a.r < b.r) swap(a, b);
    Real d = abs(a.a - b.a);
    if (sgn(a.r + b.r - d) == -1) return 4;
    if (sgn(a.r + b.r - d) == 0) return 3;
    if (sgn(a.r - b.r - d) == -1) return 2;
    if (sgn(a.r - b.r - d) == 0) return 1;
    return 0;
}

Real distance(const Pt &a, const Pt &b){
    return abs(a - b);
}

Real distance(const Line &a, const Pt &b){
    return abs(b - projection(a, b));
}

Real distance(const Line &a, const Line &b){
    return intersect(a, b) ? 0 : distance(a, b.a);
}

Real distance(const Line &a, const Segment &b){
    return intersect(a, b) ? 0 : min(distance(a, b.a), distance(a, b.b));
}

Real distance(const Segment &a, const Pt &b){//ok
    Pt p = projection(a, b);
    if (intersect(a, p)) return abs(p - b);
    return min(abs(a.a - b), abs(a.b - b));
}

Real distance(const Segment &a, const Segment &b){//ok
    if (intersect(a, b)) return 0;
    return min({distance(a, b.a), distance(a, b.b),
                distance(b, a.a), distance(b, a.b)});
}

Pt crosspoint(const Line &a, const Line &b){//ok
    return a.a + (a.b - a.a) * cross(b.a - a.a, b.b - b.a) / cross(a.b - a.a, b.b - b.a);
}

Pt crosspoint(const Segment &a, const Segment &b){//ok
    return crosspoint(Line(a), Line(b));
}

pair<Pt, Pt> crosspoint(const Circle &a, const Line &b){//ok
    Pt pt = projection(b, a.a);
    Pt e = (b.b - b.a) / abs(b.b - b.a);
    if (!sgn(distance(b, a.a) - a.r)) return {pt, pt};
    double base = sqrt(a.r * a.r - norm(pt - a.a));
    return {pt - e * base, pt + e * base};
}

pair<Pt, Pt> crosspoint(const Circle &a, const Segment &b){
    Line c = Line(b);
    if (intersect(a, b) == 2) return crosspoint(a, c);
    auto res = crosspoint(a, c);
    if (dot(b.a - res.first, b.b - res.first) < 0) res.second = res.first;
    return res;
}

bool is_convex(const Polygon &p){//ok
    ll sz = p.size();
    REP(i, sz){
        if (ccw(p[(i - 1 + sz) % sz], p[i], p[(i + 1) % sz]) == -1) return false;
    }
    return true;
}

Polygon convex_hull(Polygon &p){//ok
    int n = p.size(), k = 0;
    sort(ALL(p));
    vector<Pt> ch(2 * n);
    for (int i = 0; i < n; ch[k++] = p[i++])
        while (k >= 2 and ccw(ch[k - 2], ch[k - 1], p[i]) <= 0) k--;
    for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--])
        while (k >= t and ccw(ch[k - 2], ch[k - 1], p[i]) <= 0) k--;
    ch.resize(k - 1);
    return ch;
}


map<Pt, ll> mp;
void solve(ll n){
    vector<P> s(n);
    Polygon ps(n);
    REP(i, n){
        ll x, y;
        cin >> x >> y;
        ps[i] = Pt(x, y);
        mp[ps[i]] = i;
    }
    Polygon ch = convex_hull(ps);
    ll m = ch.size();
    bool ok = true;
    
    REP(i, m) {
        Pt a = ch[(i - 1 + m) % m];
        Pt b = ch[i];
        Pt c = ch[(i + 1) % m];
        if(abs(ccw(a, b, c)) == 1){
            ll d1 = abs(mp[b] - mp[a]), d2 = abs(mp[c] - mp[b]);
            if(min(d1, n - d1) > 1 or min(d2, n - d2) > 1) ok = false;
        }
    }
    cout << (ok ? "Yes" : "No") << endl;
}

int main(){
    while(1){
        ll n;
        cin >> n;
        if(n == 0)return 0;
        solve(n);
    }
}
accuracy: 1
time_ms: 40
memory_kb: 8092
final_rank: 15

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define rrep(i, s, t) for(ll i = (ll)(t) - 1; i >= (ll)(s); i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

#define TT template<typename T>
TT using vec = vector<T>;
template<class T1, class T2> bool chmin(T1 &x, T2 y) { return x > y ? (x = y, true) : false; }
template<class T1, class T2> bool chmax(T1 &x, T2 y) { return x < y ? (x = y, true) : false; }

struct io_setup {
    io_setup() {
        ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
        cout << fixed << setprecision(15);
    }
} io_setup;
using Point = complex<long double>;
using Polygon = vector<Point>;

struct Line {
    Point a, b;
    Line(Point a, Point b) : a(a), b(b) {}
};

struct Segment : Line {
    Segment(Point a, Point b) : Line(a, b) {}
};

struct Circle {
    Point p;
    long double r;
    Circle(Point p, long double r) : p(p), r(r) {}
};

const long double pi = acos(-1.0);
const long double EPS = 1e-12;

// 内積
long double dot(const Point &a, const Point &b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}

// 外積
long double cross(const Point &a, const Point &b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

// 直線 l に対する点 p の射影
Point projection(const Line l, const Point &p) {
    long double t = dot(p - l.a, l.b - l.a) / norm(l.b - l.a);
    return Point(l.a.real() + t * (l.b - l.a).real(), l.a.imag() + t * (l.b - l.a).imag());
}

// 直線 l に対する点 p の反射
Point reflection(const Line l, const Point &p) {
    long double t = dot(p - l.a, l.b - l.a) / norm(l.b - l.a);
    Point q(l.a.real() + t * (l.b - l.a).real(), l.a.imag() + t * (l.b - l.a).imag());
    return Point(2 * q.real() - p.real(), 2 * q.imag() - p.imag());
}

// p0 から p1 へ結んだベクトルから見た p2 の位置
int counter_clockwise(const Point &p2, Point p0, Point p1) {
    // 反時計回り
    if (cross(p1 - p0, p2 - p0) > EPS) {
        return 1;
    }
    // 時計回り
    if (cross(p1 - p0, p2 - p0) < -EPS) {
        return -1;
    }
    // p2, p0, p1 の順で同一直線上
    if (dot(p1 - p0, p2 - p0) < -EPS) {
        return 2;
    }
    // p0, p1, p2 の順で同一直線上
    if (dot(p1 - p0, p2 - p0) > norm(p1 - p0) + EPS) {
        return -2;
    }
    // p2 は p0 と p1 を結ぶ線分上
    return 0;
}

// 平行判定
bool is_parallel(const Line &l1, const Line &l2) {
    return (cross(l1.b - l1.a, l2.b - l2.a) == 0);
}

// 垂直判定
bool is_orthogonal(const Line &l1, const Line &l2) {
    return (dot(l1.b - l1.a, l2.b - l2.a) == 0);
}

// 線分と線分の交差判定
bool is_intersection(const Segment &s1, const Segment &s2) {
    return (counter_clockwise(s2.a, s1.a, s1.b) * counter_clockwise(s2.b, s1.a, s1.b) <= 0 && counter_clockwise(s1.a, s2.a, s2.b) * counter_clockwise(s1.b, s2.a, s2.b) <= 0);
}

// 線分と線分の交点の座標
Point cross_point(const Segment &s1, const Segment &s2) {
    long double d1 = cross(s1.a - s2.a, s1.b - s2.a);
    long double d2 = cross(s1.a - s1.b, s2.b - s2.a);
    if (abs(d1) < EPS && abs(d2) < EPS) {
        if (counter_clockwise(s1.a, s2.a, s2.b) == 0) return s1.a;
        else return s1.b;
    }
    return s2.a + (s2.b - s2.a) * (d1 / d2);
}

// 直線と線分の交差判定
bool is_intersection(const Line &l1, const Segment &s2) {
    return (counter_clockwise(s2.a, l1.a, l1.b) * counter_clockwise(s2.b, l1.a, l1.b) <= 0);
}

// 直線と線分の交点の座標
Point cross_point(const Line &s1, const Segment &s2) {
    long double d1 = cross(s1.a - s2.a, s1.b - s2.a);
    long double d2 = cross(s1.a - s1.b, s2.b - s2.a);
    if (abs(d1) < EPS && abs(d2) < EPS) {
        return s2.a;
    }
    return s2.a + (s2.b - s2.a) * (d1 / d2);
}

// 直線と点の距離
long double distance(const Line s, const Point &p) {
    long double t = dot(p - s.a, s.b - s.a) / norm(s.b - s.a);
    Point proj = Point(s.a.real() + t * (s.b - s.a).real(), s.a.imag() + t * (s.b - s.a).imag());
    return abs(p - proj);
}

// 線分と点の距離
long double distance(const Segment s, const Point &p) {
    long double t = dot(p - s.a, s.b - s.a) / norm(s.b - s.a);
    if (t > -EPS && t < 1 + EPS) {
        Point proj = Point(s.a.real() + t * (s.b - s.a).real(), s.a.imag() + t * (s.b - s.a).imag());
        return abs(p - proj);
    } else {
        return min(abs(p - s.a), abs(p - s.b));
    }
}

// 多角形の面積
long double area(const Polygon &poly) {
    long double ans = 0;
    int N = poly.size();
    for (int i = 0; i < N; i++) {
        ans += cross(poly[i], poly[(i + 1) % N]);
    }
    ans *= 0.5;
    return ans;
}

// 凸性判定
bool is_convex(const Polygon &poly) {
    int N = poly.size();
    for (int i = 0; i < N; i++) {
        if (counter_clockwise(poly[i], poly[(i + 1) % N], poly[(i + 2) % N]) == -1) return false;
    }
    return true;
}

// 多角形と点の包含関係
// 0 : 含まれない
// 1 : 辺の上にある
// 2 : 内部に含まれる
int is_contained(const Point p, const Polygon poly) {
    int N = poly.size();
    int cnt = 0;
    for (int i = 0; i < N; i++) {
        if (counter_clockwise(p, poly[i], poly[(i + 1) % N]) == 0) {
            return 1;
        }
        Point a = poly[i], b = poly[(i + 1) % N];
        if (a.imag() > b.imag()) swap(a, b);
        if (p.imag() < b.imag() + EPS && p.imag() > a.imag() + EPS && counter_clockwise(p, a, b) < 0) {
            cnt++;
        }
    }
    if (cnt % 2 == 0) return 0;
    else return 2;
}

// 凸包
Polygon convex_hull(vector<Point> &ps) {
    int N = ps.size();
    auto compare = [](const Point &p1, const Point &p2) {
        if (p1.real() != p2.real()) return p1.real() < p2.real();
        return p1.imag() < p2.imag();
    };
    sort(ps.begin(), ps.end(), compare);
    int k = 0;
    Polygon qs(2 * N);
    // 下側凸包
    for (int i = 0; i < N; i++) {
        while (k > 1 && cross(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) < EPS) k--;
        qs[k++] = ps[i];
    }
    // 上側凸包
    for (int i = N - 2, t = k; i >= 0; i--) {
        while (k > t && cross(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) < EPS) k--;
        qs[k++] = ps[i];
    }
    qs.resize(k - 1);
    return qs;
}

// 最も遠い２点の距離を求める
long double farest_pair(vector<Point> &ps) {
    Polygon poly = convex_hull(ps);
    long double ans = 0;
    for (int i = 0; i < (int)poly.size(); i++) {
        for (int j = 0; j < i; j++) {
            ans = max(ans, abs(poly[i] - poly[j]));
        }
    }
    return ans;
}

// 直線 l で凸多角形を切断し、左側の凸多角形を出力する
Polygon convex_cut(const Polygon &poly, const Line &l) {
    int N = poly.size();
    vector<Point> ps;
    for (int i = 0; i < N; i++) {
        if (cross(l.b - l.a, poly[i] - l.a) > -EPS) {
            ps.push_back(poly[i]);
        }
        if (is_intersection(l, Segment(poly[i], poly[(i + 1) % N]))) {
            ps.push_back(cross_point(l, Segment(poly[i], poly[(i + 1) % N])));
        }
    }
    if (ps.size() <= 0) return {};
    Polygon ch = convex_hull(ps);
    return ch;
}

// 最も近い２点の距離を求める
long double closest_pair(vector<Point> &ps) {
    auto dfs = [&](auto dfs, vector<Point> qs) -> long double {
        int N = qs.size();
        if (N <= 1) return 1e18;
        sort(qs.begin(), qs.end(), [](const Point &p1, const Point &p2) {
            if (abs(p1.real() - p2.real()) < EPS) return p1.imag() < p2.imag();
            return p1.real() < p2.real();
        });
        vector<Point> P1, P2;
        for (int i = 0; i < N / 2; i++) P1.push_back(qs[i]);
        for (int i = N / 2; i < N; i++) P2.push_back(qs[i]);
        long double d1 = dfs(dfs, P1), d2 = dfs(dfs, P2);
        long double d = min(d1, d2), ans = d;
        long double px = P1[N / 2 - 1].real(), py = P1[N / 2 - 1].imag();
        vector<pair<long double, int>> V;
        for (int i = 0; i < N; i++) {
            if (qs[i].real() < px - d - EPS || qs[i].real() > px + d + EPS) continue;
            V.push_back(make_pair(qs[i].imag(), i));
        }
        sort(V.begin(), V.end());
        int r = 0;
        for (int l = 0; l < (int)V.size(); l++) {
            r = max(r, l);
            while (r < (int)V.size() && V[r].first < V[l].first + d + EPS) {
                if (l != r) ans = min(ans, abs(qs[V[l].second] - qs[V[r].second]));
                r++;
            }
        }
        return ans;
    };
    return dfs(dfs, ps);
}

// 円の交差判定
int intersection_of_circle(const Circle &c1, const Circle &c2) {
    long double d = abs(c1.p - c2.p);
    // 分離
    if (d > c1.r + c2.r + EPS) {
        return 4;
    }
    // 外接
    if (abs(d - c1.r - c2.r) < EPS) {
        return 3;
    }
    // 交差
    if (d < c1.r + c2.r - EPS && d > abs(c1.r - c2.r) + EPS) {
        return 2;
    }
    // 内接
    if (abs(d - abs(c1.r - c2.r)) < EPS) {
        return 1;
    }
    // 包含
    return 0;
}

// 内接円
Circle incircle(const Point &p1, const Point &p2, const Point &p3) {
    long double d = abs((p1 - p2)) + abs(p2 - p3) + abs(p3 - p1);
    Point p = p1 + (abs(p3 - p1) / d) * (p2 - p1) + (abs(p2 - p1) / d) * (p3 - p1);
    long double r = abs(cross(p2 - p1, p3 - p1)) / d;
    return Circle(p, r);
}

// 外接円
Circle circumscribed_circle(const Point &p1, const Point &p2, const Point &p3) {
    long double a = abs(p1 - p2), b = abs(p2 - p3), c = abs(p3 - p1), S = abs(cross(p2 - p1, p3 - p1)) * 0.5;
    long double cx = norm(p2 - p1) * (p3 - p1).imag() - norm(p3 - p1) * (p2 - p1).imag(), cy = norm(p3 - p1) * (p2 - p1).real() - norm(p2 - p1) * (p3 - p1).real();
    cx /= 2.0 * cross(p2 - p1, p3 - p1);
    cy /= 2.0 * cross(p2 - p1, p3 - p1);
    Point p = p1 + Point(cx, cy);
    long double r = a * b * c / (4.0 * S);
    return Circle(p, r);
}

// 円と直線の交点
vector<Point> cross_points(Circle c, Line l) {
    Point proj = projection(l, c.p);
    long double d = abs(proj - c.p);
    if (d > c.r + EPS) {
        return {};
    } else if (abs(c.r - abs(proj - c.p)) < EPS) {
        return {proj};
    } else {
        long double s = sqrt(c.r * c.r - norm(proj - c.p));
        return {proj - (s / abs(l.b - l.a)) * (l.b - l.a), proj + (s / abs(l.b - l.a)) * (l.b - l.a)};
    }
}

// 円と円の交点
vector<Point> cross_points(Circle c1, Circle c2) {
    int t = intersection_of_circle(c1, c2);
    if (t == 0 || t == 4) {
        return {};
    }
    if (t == 3) {
        return {c1.p + (c1.r / (c1.r + c2.r)) * (c2.p - c1.p)};
    }
    if (t == 1) {
        if (c1.r > c2.r) return {(-c2.r / abs(c1.r - c2.r)) * c1.p + (c1.r / abs(c1.r - c2.r)) * c2.p};
        return {(c2.r / abs(c1.r - c2.r)) * c1.p + (-c1.r / abs(c1.r - c2.r)) * c2.p};
    }
    long double d = abs(c1.p - c2.p);
    long double s = (c1.r * c1.r - c2.r * c2.r + d * d) / (2.0 * d);
    Point p = c1.p + (s / d) * (c2.p - c1.p);
    return {p - (sqrt(c1.r * c1.r - s * s) / d) * Point((c2.p - c1.p).imag(), -(c2.p - c1.p).real()), p + (sqrt(c1.r * c1.r - s * s) / d) * Point((c2.p - c1.p).imag(), -(c2.p - c1.p).real())};
}

// 円の接線
vector<Point> tangent(Circle c, Point p) {
    return cross_points(c, Circle(p, sqrt(norm(c.p - p) - c.r * c.r)));
}

// 円の共通部分の面積
long double area_of_intersection(Circle c1, Circle c2) {
    int t = intersection_of_circle(c1, c2);
    if (t >= 3) {
        return 0;
    }
    if (t <= 1) {
        return pi * min(c1.r, c2.r) * min(c1.r, c2.r);
    }
    vector<Point> ps = cross_points(c1, c2);
    long double a1 = arg(ps[0] - c1.p) - arg(ps[1] - c1.p), a2 = arg(ps[1] - c2.p) - arg(ps[0] - c2.p);
    if (a1 < -EPS) a1 += 2.0 * pi;
    if (a2 < -EPS) a2 += 2.0 * pi;
    return (a1 / 2) * c1.r * c1.r + (a2 / 2) * c2.r * c2.r - abs(area({ps[0], c1.p, ps[1], c2.p}));
}

int solve(int N,vector<Point>P){
    rep(i,0,N-1)rep(j,i+1,N){
        vector<pair<long double,int>>vpx,vpy;
        set<int>se;
        vector<bool>flag(N);
        rep(k,0,N){
            int c=counter_clockwise(P[i],P[j],P[k]);
            if(abs(c)%2==0){
                vpx.push_back({P[k].real(),k});
                vpy.push_back({P[k].imag(),k});
                flag[k]=true;
            }else{
                se.insert(c);
            }
        }
        if((int)se.size()==2)continue;
        sort(all(vpx));
        sort(all(vpy));
        if(abs(vpx.front().first-vpx.back().first)<EPS)swap(vpx,vpy);
        int a=vpx.front().second,b=vpx.back().second;
        if((!flag[(a+1)%N]&&!flag[(a-1+N)%N])||(!flag[(b+1)%N]&&!flag[(b-1+N)%N])){
            return false;
        }
    }
    return true;
}

int main() {
    while(1){
        int N;
        cin>>N;
        if(N==0)return 0;
        vector<Point>P(N);
        rep(i,0,N){
            int x,y;
            cin>>x>>y;
            Point p(x,y);
            P[i]=p;
        }
        bool ans=solve(N,P);
        if(ans)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}
accuracy: 1
time_ms: 3220
memory_kb: 3712
final_rank: 16

code_snippet: #include <bits/stdc++.h>
#include <cstdint>
#include <cstddef>

namespace zawa {

using i16 = std::int16_t;
using i32 = std::int32_t;
using i64 = std::int64_t;
using i128 = __int128_t;

using u8 = std::uint8_t;
using u16 = std::uint16_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;

using usize = std::size_t;

} // namespace zawa

#include <cassert>

namespace zawa {

namespace geometryZ2 {

using Zahlen = i64;

namespace internal {

constexpr i32 positive{1};
constexpr i32 zero{0};
constexpr i32 negative{-1};

} // namespace internal

constexpr i32 Sign(Zahlen value) {
    if (value < 0) return internal::negative;
    if (value > 0) return internal::positive;
    return internal::zero;
}

constexpr bool Positive(Zahlen value) {
    return Sign(value) == internal::positive;
}

constexpr bool Zero(Zahlen value) {
    return Sign(value) == internal::zero;
}

constexpr bool Negative(Zahlen value) {
    return Sign(value) == internal::negative;
}

constexpr Zahlen Abs(Zahlen value) {
    return (value > 0 ? value : -value);
}

constexpr Zahlen Square(Zahlen value) {
    return value * value;
}

} // namespace geometryZ2

} // namespace zawa

#include <algorithm>
#include <iostream>
#include <limits>

namespace zawa {

namespace geometryZ2 {

class Point {
private:
    Zahlen x_{}, y_{};
    static constexpr i32 origin{0};
    static constexpr i32 firstQuadrant{1};
    static constexpr i32 secondQuadrant{2};
    static constexpr i32 thirdQuadrant{-2};
    static constexpr i32 forthQuadrant{-1};
public:
    /* constructor */
    Point() = default;
    Point(const Point& p) : x_{p.x()}, y_{p.y()} {}
    Point(Zahlen x, Zahlen y) : x_{x}, y_{y} {}

    /* getter setter */
    Zahlen& x() {
        return x_;
    }
    const Zahlen& x() const {
        return x_;
    }
    Zahlen& y() {
        return y_;
    }
    const Zahlen& y() const {
        return y_;
    }

    /* operator */
    Point& operator=(const Point& p) {
        x() = p.x();
        y() = p.y();
        return *this;
    }
    Point& operator+=(const Point& p) {
        x() += p.x();
        y() += p.y();
        return *this;
    }
    friend Point operator+(const Point& p0, const Point& p1) {
        return Point{p0} += p1;
    }
    Point& operator-=(const Point& p) {
        x() -= p.x();
        y() -= p.y();
        return *this;
    }
    friend Point operator-(const Point& p0, const Point& p1) {
        return Point{p0} -= p1;
    }
    Point& operator*=(Zahlen k) {
        x() *= k;
        y() *= k;
        return *this;
    }
    friend Point operator*(const Point& p, Zahlen k) {
        return Point{p} *= k;
    }
    friend Point operator*(Zahlen k, const Point& p) {
        return Point{p} *= k;
    }
    Point& operator/=(Zahlen k) {
        assert(k);
        assert(x() % k == 0);
        assert(y() % k == 0);
        x() /= k;
        y() /= k;
        return *this;
    }
    friend Point operator/(const Point& p, Zahlen k) {
        return Point{p} /= k;
    }
    friend bool operator==(const Point& p0, const Point& p1) {
        return p0.x() == p1.x() and p0.y() == p1.y();
    }
    friend bool operator!=(const Point& p0, const Point& p1) {
        return p0.x() != p1.x() or p0.y() != p1.y();
    }
    friend bool operator<(const Point& p0, const Point& p1) {
        if (p0.x() != p1.x()) return p0.x() < p1.x();
        else return p0.y() < p1.y();
    }
    friend bool operator<=(const Point& p0, const Point& p1) {
        return (p0 < p1) or (p0 == p1);
    }
    friend bool operator>(const Point& p0, const Point& p1) {
        if (p0.x() != p1.x()) return p0.x() > p1.x();
        else return p0.y() > p1.y();
    }
    friend bool operator>=(const Point& p0, const Point& p1) {
        return (p0 > p1) or (p0 == p1);
    }
    friend std::istream& operator>>(std::istream& is, Point& p) {
        is >> p.x() >> p.y();
        return is;
    }
    friend std::ostream& operator<<(std::ostream& os, const Point& p) {
        os << '(' << p.x() << ',' << p.y() << ')';
        return os;
    }

    /* member function */
    Zahlen normSquare() const {
        return Square(x()) + Square(y());
    }
    bool isNormSquareOver(Zahlen d) const {
        assert(!Negative(d));
        auto [mn, mx]{std::minmax({ Abs(x()), Abs(y()) })};
        if (mx and mx > d / mx) {
            return true;
        }
        long long s1{Square(mn)}, s2{Square(mx)};
        if (s1 > d - s2) {
            return true;
        }
        return false;
    }
    bool isNormSquareOverflow() const {
        return isNormSquareOver(std::numeric_limits<Zahlen>::max());
    }

    i32 area() const {
        if (x_ == 0 and y_ == 0) return origin;
        if (x_ <= 0 and y_ < 0) return thirdQuadrant;
        if (x_ > 0 and y_ <= 0) return forthQuadrant;
        if (x_ >= 0 and y_ > 0) return firstQuadrant;
        return secondQuadrant;
    }

    /* static member */
    static bool ArgComp(const Point& p0, const Point& p1) {
        if (p0.area() != p1.area()) return p0.area() < p1.area();
        Zahlen cross{Cross(p0, p1)};
        return (!Zero(cross) ? Positive(cross) : p0.normSquare() < p1.normSquare());
    }

    /* friend function */
    friend Zahlen Dot(const Point& p0, const Point& p1) {
        return p0.x() * p1.x() + p0.y() * p1.y();
    }
    friend Zahlen Cross(const Point& p0, const Point& p1) {
        return p0.x() * p1.y() - p0.y() * p1.x();
    }
};
using Vector = Point;

} // namespace geometryZ2

} // namespace zawa

#include <vector>

namespace zawa {

namespace geometryZ2 {

using PointCloud = std::vector<Point>;

void ArgSort(PointCloud& p) {
    std::sort(p.begin(), p.end(), Point::ArgComp);
}

} // namespace geometryZ2

} // namespace zawa



namespace zawa {

namespace geometryZ2 {

enum RELATION {
    // p0 -> p1 -> p2の順で直線上に並んでいる
    ONLINE_FRONT        = -2,
    // (p1 - p0) -> (p2 - p0)が時計回りになっている
    CLOCKWISE           = -1,
    // p0 -> p2 -> p1の順で直線上に並んでいる
    ON_SEGMENT          =  0,
    // (p1 - p0) -> (p2 - p0)が反時計回りになっている
    COUNTER_CLOCKWISE   = +1,
    // p2 -> p0 -> p1、またはp1 -> p0 -> p2の順で直線上に並んでいる
    ONLINE_BACK         = +2
};

RELATION Relation(const Point& p0, const Point& p1, const Point& p2) {
    Point a{p1 - p0}, b{p2 - p0};
    if (Positive(Cross(a, b))) return COUNTER_CLOCKWISE;
    if (Negative(Cross(a, b))) return CLOCKWISE;
    if (Negative(Dot(a, b))) return ONLINE_BACK;
    if (a.normSquare() < b.normSquare()) return ONLINE_FRONT;
    return ON_SEGMENT;
};

} // namespace geometryZ2

} // namespace zawa

#include <iterator>
#include <type_traits>

namespace zawa {

namespace geometryZ2 {

class Polygon {
private:
    std::vector<Point> data_;
public:
    usize size() const {
        return data_.size();
    }

    /* constructor */
    Polygon() = default;
    Polygon(const Polygon& polygon) : data_{polygon.data_} {}
    Polygon(const std::vector<Point>& data) : data_{data} {}
    Polygon(usize n) : data_{n} {
        assert(n >= static_cast<usize>(3));
    }

    /* operator */
    Polygon& operator=(const Polygon& polygon) {
        data_ = polygon.data_;
        return *this;
    }
    Point& operator[](usize i) {
        assert(i < size());
        return data_[i];
    }
    const Point& operator[](usize i) const {
        assert(i < size());
        return data_[i];
    }
    friend std::istream& operator>>(std::istream& is, Polygon& polygon) {
        for (size_t i{} ; i < polygon.size() ; i++) {
            is >> polygon[i];
        }
        return is;
    }
    friend std::ostream& operator<<(std::ostream& os, const Polygon& polygon) {
        for (usize i{} ; i < polygon.size() ; i++) {
            std::cout << polygon[i] << (i + 1 == polygon.size() ? "" : " ");
        }
        return os;
    }

    /* member function */
    void reserve(usize n) {
        data_.reserve(n);
    }
    void pushBack(const Point& p) {
        data_.push_back(p);
    }
    void emplaceBack(Zahlen x, Zahlen y) {
        data_.emplace_back(x, y);
    }
    template <class RandomAccessIterator>
    void insert(usize n, RandomAccessIterator first, RandomAccessIterator last) {
        assert(n <= size());
        data_.insert(std::next(data_.begin(), n), first, last);
    }
    void orderRotate(usize i) {
        assert(i < size());
        std::rotate(data_.begin(), data_.begin() + i, data_.end());
    }
    template <class F>
    void normalForm(const F& func) {
        auto index{std::distance(data_.begin(), std::min_element(data_.begin(), data_.end(), func))};
        orderRotate(index);
    }
    void normalForm() {
        auto index{std::distance(data_.begin(), std::min_element(data_.begin(), data_.end()))};
        orderRotate(index);
    }
    template <class F>
    Polygon normalFormed(const F& func = [](const Point& a, const Point& b) -> bool { return a < b; }) const {
        Polygon res{*this};
        res.normalForm(func);
        return res;
    }
    Polygon normalFormed() {
        Polygon res{*this};
        res.normalForm();
        return res;
    }
    bool isConvex() const {
        assert(size() >= static_cast<usize>(3));
        for (usize i{} ; i < size() ; i++) {
            if (Relation(data_[i], data_[i+1==size()?0:i+1], data_[i+2>=size()?i+2-size():i+2])
                    == CLOCKWISE) {
                return false;
            }
        }
        return true;
    }
    Zahlen areaTwice() const {
        assert(size() >= static_cast<usize>(3));
        Zahlen res{};
        for (usize i{1} ; i < size() ; i++) {
            res += Cross(data_[i] - data_[0], data_[i+1==size()?0:i+1] - data_[0]);
        }
        return res;
    }
    Polygon subtriangle(usize i, usize j, usize k) const {
        assert(i < size());
        assert(j < size());
        assert(k < size());
        return Polygon{std::vector<Point>{ data_[i], data_[j], data_[k] }};
    }
};

}

} // namespace zawa


namespace zawa {

namespace geometryZ2 {

template <bool strictly>
Polygon ConvexHull(const PointCloud& p) {
    PointCloud cp{p};
    std::sort(cp.begin(), cp.end());
    cp.erase(std::unique(cp.begin(), cp.end()), cp.end());
    if (cp.size() <= 2u) {
        return Polygon{cp};
    }
    PointCloud lower;
    lower.reserve(p.size());
    for (auto it{cp.begin()} ; it != cp.end() ; it++) {
        lower.push_back(*it);
        while (lower.size() >= 3u) {
            if (Relation(lower[lower.size() - 3], lower[lower.size() - 2], lower[lower.size() - 1]) == COUNTER_CLOCKWISE) {
                break;
            }
            if constexpr (!strictly) {
                if (Relation(lower[lower.size() - 3], lower[lower.size() - 2], lower[lower.size() - 1]) == ONLINE_FRONT) {
                    break;
                }
            }
            std::swap(lower[lower.size() - 2], lower[lower.size() - 1]);
            lower.pop_back();
        }
    }
    PointCloud upper;
    upper.reserve(p.size());
    for (auto it{cp.rbegin()} ; it != cp.rend() ; it++) {
        upper.push_back(*it);
        while (upper.size() >= 3u) {
            if (Relation(upper[upper.size() - 3], upper[upper.size() - 2], upper[upper.size() - 1]) == COUNTER_CLOCKWISE) {
                break;
            }
            if constexpr (!strictly) {
                if (Relation(upper[upper.size() - 3], upper[upper.size() - 2], upper[upper.size() - 1]) == ONLINE_FRONT) {
                    break;
                }
            }
            std::swap(upper[upper.size() - 2], upper[upper.size() - 1]);
            upper.pop_back();
        }
    }

    Polygon res;
    res.reserve(lower.size() + upper.size() - 2);
    res.insert(res.size(), lower.begin(), lower.end());
    res.insert(res.size(), std::next(upper.begin()), std::prev(upper.end()));
    return res;
}

} // namespace geometryZ2

} // namespace zawa
using namespace zawa::geometryZ2;
int N;
bool solve() {
    PointCloud p(N);
    for (int i = 0 ; i < N ; i++) std::cin >> p[i];
    Polygon poly = p, ch = ConvexHull<true>(p);
    std::vector<bool> ok(ch.size());
    // ch[0] -> ch[1]の被覆
    for (int i = 0 ; i < std::ssize(ch) ; i++) {
        bool cur = false;
        for (int j = 0 ; j < N ; j++) if (ch[i] == p[j]) {
            for (int k : {-1, 1}) {
                cur |= ch[(i+1)%ch.size()] == p[(j+k+N)%N];
                cur |= Relation(ch[i], ch[(i+1)%ch.size()], p[(j+k+N)%N]) == ON_SEGMENT;
            }
        }
        ok[i] = cur;
    }
    // ch[1] -> ch[0]の被覆
    std::vector<bool> ko(ch.size());
    for (int i = 0 ; i < std::ssize(ch) ; i++) {
        bool cur = false;
        for (int j = 0 ; j < N ; j++) if (ch[i] == p[j]) {
            for (int k : {-1, 1}) {
                cur |= ch[(i-1+ch.size())%ch.size()] == p[(j+k+N)%N];
                cur |= Relation(ch[i], ch[(i-1+ch.size())%ch.size()], p[(j+k+N)%N]) == ON_SEGMENT;
            }
        }
        ko[i] = cur;
    }
    return (int)std::ranges::count(ok, true) + (int)std::ranges::count(ko, true) == 2 * std::ssize(ch);
}
int main() {
    while (true) {
        std::cin >> N;
        if (N == 0) break;
        std::cout << (solve() ? "Yes\n" : "No\n");
    }
}
accuracy: 1
time_ms: 20
memory_kb: 3712
final_rank: 13

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
template <class T, class U>
inline bool chmax(T &a, U b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T, class U>
inline bool chmin(T &a, U b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline void compress(vector<T> &a) {
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
}
template <class T>
T rand(T l, T r) {
    static mt19937 mt(random_device{}());
    // [l, r)
    if constexpr (is_integral_v<T>) {
        return uniform_int_distribution<T>(l, r - 1)(mt);
    } else if constexpr (is_floating_point_v<T>) {
        return uniform_real_distribution<T>(l, r)(mt);
    }
}
constexpr int INF = 1001001001;
constexpr ll llINF = 3000000000000000010;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using pbds_set = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;
using pbds_mset = tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>;
using pbds_umap = gp_hash_table<int, int>;
using pbds_trie = trie<string, null_type, trie_string_access_traits<>, pat_trie_tag, trie_prefix_search_node_update>;
struct linear_sieve {
    vector<int> least_factor, prime_list;
    linear_sieve(int n) : least_factor(n + 1, 0) {
        for (int i = 2; i <= n; i++) {
            if (least_factor[i] == 0) {
                least_factor[i] = i;
                prime_list.push_back(i);
            }
            for (int p : prime_list) {
                if (ll(i) * p > n || p > least_factor[i]) break;
                least_factor[i * p] = p;
            }
        }
    }
};
namespace Geometry {

constexpr double eps = 1e-10;
template <class T>
constexpr int sign(const T &a) {
    if (isZero(a)) return 0;
    if (a > 0) return 1;
    return -1;
}
template <class T, class U>
constexpr bool equal(const T &a, const U &b) {
    return isZero(a - b);
}
template <class T>
constexpr bool isZero(const T &a) {
    if (is_floating_point<T>()) return fabs(a) < eps;
    return a == 0;
}
template <class T>
constexpr T square(const T &a) {
    return a * a;
}
template <class T>
struct Vec2 {
    T x, y;
    Vec2() = default;
    Vec2(T x, T y) : x(x), y(y) {};
    constexpr Vec2 &operator+=(const Vec2 &P) {
        x += P.x, y += P.y;
        return *this;
    }
    constexpr Vec2 &operator-=(const Vec2 &P) {
        x -= P.x, y -= P.y;
        return *this;
    }
    constexpr Vec2 &operator*=(const T k) {
        x *= k, y *= k;
        return *this;
    }
    constexpr Vec2 &operator/=(const T k) {
        x /= k, y /= k;
        return *this;
    }
    constexpr Vec2 operator+() const { return *this; }
    constexpr Vec2 operator-() const { return {-x, -y}; }
    constexpr Vec2 operator+(const Vec2 &P) const { return {x + P.x, y + P.y}; }
    constexpr Vec2 operator-(const Vec2 &P) const { return {x - P.x, y - P.y}; }
    constexpr Vec2 operator*(const T k) const { return {x * k, y * k}; }
    constexpr Vec2 operator/(const T k) const { return {x / k, y / k}; }
    constexpr bool operator==(const Vec2 &P) const { return isZero(x - P.x) && isZero(y - P.y); }
    constexpr bool operator!=(const Vec2 &P) const { return !(*this == P); }
    constexpr bool operator<(const Vec2 &P) const {
        if (!isZero(x - P.x)) return x < P.x;
        return y < P.y;
    }
    constexpr bool operator>(const Vec2 &P) const { return P < *this; }
    constexpr bool isZeroVec() const { return x == T(0) && y == T(0); }
    constexpr T abs2() const { return x * x + y * y; }
    constexpr T abs() const { return sqrt(abs2()); }
    constexpr T dot(const Vec2 &v) const { return x * v.x + y * v.y; }
    constexpr T cross(const Vec2 &v) const { return x * v.y - y * v.x; }
    constexpr T dist(const Vec2 &P) const { return (P - (*this)).abs(); }
    constexpr T distSq(const Vec2 &P) const { return (P - (*this)).abs2(); }
    constexpr T unitVec() const { return (*this) / abs(); }
    Vec2 &unitize() { return *this /= abs(); }
    friend constexpr T abs2(const Vec2 &P) { return P.abs2(); }
    friend constexpr T abs(const Vec2 &P) { return P.abs(); }
    friend constexpr T dot(const Vec2 &P, const Vec2 &Q) { return P.dot(Q); }
    friend constexpr T dot(const Vec2 &A, const Vec2 &B, const Vec2 &C) { return (B - A).dot(C - A); }
    friend constexpr T cross(const Vec2 &P, const Vec2 &Q) { return P.cross(Q); }
    friend constexpr T cross(const Vec2 &A, const Vec2 &B, const Vec2 &C) { return (B - A).cross(C - A); }
    friend constexpr T dist(const Vec2 &P, const Vec2 &Q) { return P.dist(Q); }
    friend constexpr T distSq(const Vec2 &P, const Vec2 &Q) { return P.distSq(Q); }
};
template <class T>
constexpr int ccw(const Vec2<T> &A, const Vec2<T> &B, const Vec2<T> &C) {
    if (cross(B - A, C - A) > eps) return +1;
    if (cross(B - A, C - A) < -eps) return -1;
    if (dot(B - A, C - A) < -eps) return +2;
    if (abs2(B - A) + eps < abs2(C - A)) return -2;
    return 0;
}
struct Line {
    using T = double;
    using Point = Vec2<T>;
    Point A, B;
    Line() = default;
    Line(Point A, Point B) : A(A), B(B) {}
    constexpr Point vec() const { return B - A; }
    constexpr bool isParallelTo(const Line &L) const { return isZero(cross(vec(), L.vec())); }
    constexpr bool isOrthogonalTo(const Line &L) const { return isZero(dot(vec(), L.vec())); }
    constexpr T distanceFrom(const Point &P) const { return abs(cross(P - A, vec())) / vec().abs(); }
    constexpr Point crosspoint(const Line &L) const { return A + vec() * (cross(A - L.A, L.vec())) / cross(L.vec(), vec()); }
    friend constexpr Point crosspoint(const Line &L, const Line &M) { return L.crosspoint(M); }
};
struct Segment : Line {
    Segment() = default;
    Segment(Point A, Point B) : Line(A, B) {}
    constexpr bool intersect(const Segment &L) const { return ccw(L.A, L.B, A) * ccw(L.A, L.B, B) <= 0 && ccw(A, B, L.A) * ccw(A, B, L.B) <= 0; }
    constexpr T distanceFrom(const Point &P) const {
        if (dot(P - A, vec()) < 0) return P.dist(A);
        if (dot(P - B, vec()) > 0) return P.dist(B);
        return Line::distanceFrom(P);
    }
    constexpr T distanceFrom(const Segment &L) const {
        if (intersect(L)) return 0;
        return min({Segment::distanceFrom(L.A), Segment::distanceFrom(L.B), Segment(L).distanceFrom(A), Segment(L).distanceFrom(B)});
    }
};
struct intLine {
    using T = long long;
    using Point = Vec2<T>;
    Point A, B;
    intLine() = default;
    intLine(Point A, Point B) : A(A), B(B) {}
    constexpr Point vec() const { return B - A; }
    constexpr bool isParallelTo(const intLine &L) const { return isZero(cross(vec(), L.vec())); }
    constexpr bool isOrthogonalTo(const intLine &L) const { return isZero(dot(vec(), L.vec())); }
    constexpr double distanceSqFrom(const Point &P) const { return square(cross(P - A, vec())) / vec().abs2(); }
    // constexpr Point crosspoint(const intLine &L) const { return A + vec() * (cross(A - L.A, L.vec())) / cross(L.vec(), vec()); }
};
struct intSegment : intLine {
    intSegment() = default;
    intSegment(Point A, Point B) : intLine(A, B) {}
    constexpr bool intersect(const intSegment &L) const { return ccw(L.A, L.B, A) * ccw(L.A, L.B, B) <= 0 && ccw(A, B, L.A) * ccw(A, B, L.B) <= 0; }
    constexpr T distanceSqFrom(const Point &P) {
        if (dot(P - A, vec()) < 0) return P.distSq(A);
        if (dot(P - B, vec()) > 0) return P.distSq(B);
        return intLine::distanceSqFrom(P);
    }
    constexpr T distanceSqFrom(const intSegment &L) {
        if (intersect(L)) return 0;
        return min(
            {intSegment::distanceSqFrom(L.A), intSegment::distanceSqFrom(L.B), intSegment(L).distanceSqFrom(A), intSegment(L).distanceSqFrom(B)});
    }
    friend constexpr bool intersect(const intSegment &L, const intSegment &M) { return L.intersect(M); }
};
template <class T>
vector<T> convex_hull(vector<T> ps) {
    sort(ps.begin(), ps.end());
    ps.erase(unique(ps.begin(), ps.end()), ps.end());
    int n = ps.size();
    if (n <= 2) return ps;
    vector<T> qs;
    for (auto &p : ps) {
        //<=0 if want to remove "3 points on a same line"
        while (qs.size() > 1 && cross(qs[qs.size() - 2], qs[qs.size() - 1], p) <= 0) {
            qs.pop_back();
        }
        qs.push_back(p);
    }
    int t = qs.size();
    for (int i = n - 2; i >= 0; i--) {
        T &p = ps[i];
        while ((int)qs.size() > t && cross(qs[qs.size() - 2], qs[qs.size() - 1], p) <= 0) {
            qs.pop_back();
        }
        if (i) qs.push_back(p);
    }
    return qs;
}

template <typename T>
inline istream &operator>>(istream &is, Vec2<T> &rhs) {
    return is >> rhs.x >> rhs.y;
}
template <typename T>
inline ostream &operator<<(ostream &os, Vec2<T> &rhs) {
    return os << rhs.x << " " << rhs.y;
}
inline istream &operator>>(istream &is, Line &rhs) { return is >> rhs.A >> rhs.B; }
inline ostream &operator<<(ostream &os, Line &rhs) { return os << rhs.A << rhs.B; }
inline istream &operator>>(istream &is, Segment &rhs) { return is >> rhs.A >> rhs.B; }
inline ostream &operator<<(ostream &os, Segment &rhs) { return os << rhs.A << rhs.B; }
inline istream &operator>>(istream &is, intLine &rhs) { return is >> rhs.A >> rhs.B; }
inline ostream &operator<<(ostream &os, intLine &rhs) { return os << rhs.A << rhs.B; }
inline istream &operator>>(istream &is, intSegment &rhs) { return is >> rhs.A >> rhs.B; }
inline ostream &operator<<(ostream &os, intSegment &rhs) { return os << rhs.A << rhs.B; }
};  // namespace Geometry
constexpr long long safe_mod(long long x, long long m) {
    x %= m;
    if (x < 0) x += m;
    return x;
}
struct HLD {
    vector<vector<int>> g;
    vector<int> sz, in, out, par, head, dep, ord;
    HLD(vector<vector<int>> &g_, int root = 0)
        : g(g_), sz((int)g_.size()), in((int)g_.size()), out((int)g_.size()), par((int)g_.size()), head((int)g_.size(), root), dep((int)g_.size()) {
        dfs_sz(root, -1);
        dfs_hld(root, -1);
    }
    void dfs_sz(int v, int p) {
        par[v] = p;
        sz[v] = 1;
        if (g[v].size() && g[v][0] == p) swap(g[v][0], g[v].back());
        for (auto &i : g[v]) {
            if (i != p) {
                dep[i] = dep[v] + 1;
                dfs_sz(i, v);
                sz[v] += sz[i];
                if (sz[g[v][0]] < sz[i]) swap(g[v][0], i);
            }
        }
    }
    void dfs_hld(int v, int p) {
        in[v] = ord.size();
        ord.push_back(v);
        for (auto i : g[v]) {
            if (i != p) {
                if (i == g[v][0]) {
                    // Heavy
                    head[i] = head[v];
                } else {
                    // Light
                    head[i] = i;
                }
                dfs_hld(i, v);
            }
        }
        out[v] = ord.size();
    }
    int lca(int u, int v) {
        while (1) {
            if (in[u] > in[v]) swap(u, v);
            if (head[u] == head[v]) return u;
            v = par[head[v]];
        }
    }
    int dist(int u, int v) { return dep[u] + dep[v] - 2 * dep[lca(u, v)]; }
    int la(int v, int d) {
        while (v != -1) {
            int u = head[v];
            if (in[v] - d >= in[u]) return ord[in[v] - d];
            d -= in[v] - in[u] + 1, v = par[u];
        }
        return -1;
    }
    int jump(int from, int to, int d) {
        int l = lca(from, to);
        if (d <= dep[from] - dep[l]) return la(from, d);
        d -= dep[from] - dep[l];
        if (d <= dep[to] - dep[l]) return la(to, dep[to] - dep[l] - d);
        return -1;
    }
};
template <typename T, typename U>
inline istream &operator>>(istream &is, pair<T, U> &rhs) {
    return is >> rhs.first >> rhs.second;
}
template <typename T>
inline istream &operator>>(istream &is, vector<T> &v) {
    for (auto &e : v) is >> e;
    return is;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    return os << rhs.first << " " << rhs.second;
}
template <typename T>
inline ostream &operator<<(ostream &os, const vector<T> &v) {
    for (auto itr = v.begin(), end_itr = v.end(); itr != end_itr;) {
        os << *itr;
        if (++itr != end_itr) os << " ";
    }
    return os;
}

void solve() {
    int n;
    cin >> n;
    if (n == 0) exit(0);
    using namespace Geometry;
    vector<Vec2<ll>> p(n);
    cin >> p;
    auto cv = convex_hull(p);
    int K = cv.size();
    cv.push_back(cv[0]);
    p.push_back(p[0]);
    rep(i, K) {
        bool ok = false;
        bool ok2 = false;
        rep(j, n) {
            auto L = intLine(cv[i], cv[i + 1]);
            auto M = intLine(p[j], p[j + 1]);
            if (L.isParallelTo(M) && (L.A == M.A || L.A == M.B)) ok = true;
            if (L.isParallelTo(M) && (L.B == M.A || L.B == M.B)) ok2 = true;
        }
        if (!ok || !ok2) {
            cout << "No\n";
            return;
        }
    }
    cout << "Yes\n";
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while (1) solve();
}
accuracy: 1
time_ms: 10
memory_kb: 3436
final_rank: 2

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ld = long double;
#undef long
#define long long long
#define ll long
#define vec vector
#define rep(i, n) for (long i = 0; i < n; i++)
#define all(a) begin(a), end(a)
#define sz(a) (int)(a).size()
template <typename T>
bool chmin(T &x, T y)
{
    if (y < x)
    {
        x = y;
        return true;
    }
    return false;
}
template <typename T>
bool chmax(T &x, T y)
{
    if (x < y)
    {
        x = y;
        return true;
    }
    return false;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> a)
{
    const int n = a.size();
    rep(i, n)
    {
        os << a[i];
        if (i + 1 != n)
            os << " ";
    }
    return os;
}
using R = ld;
constexpr R EPS = 1e-10;
using point = complex<R>;
using points = vec<point>;
using polygon = vec<point>;
R cross(const point &a, const point &b) { return real(a) * imag(b) - imag(a) * real(b); }
R dot(const point &a, const point &b) { return real(a) * real(b) + imag(a) * imag(b); }
namespace std
{
    bool operator<(const point &a, const point &b)
    {
        return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
    }
}
enum CCW
{
    ONLINE_FRONT = -2,     // a,b,c が一直線上
    CLOCKWISE = -1,        // c が a,b から時計回り側
    ON_SEGMENT = 0,        // a,c,b が一直線上
    COUNTER_CLOCKWISE = 1, // c が a,b から反時計回り側
    ONLINE_BACK = 2,       // c,a,b が一直線上
};
int ccw(const point &a, point b, point c)
{
    b -= a, c -= a;
    const R crs_b_c = cross(b, c);
    if (crs_b_c > EPS)
        return CCW::COUNTER_CLOCKWISE;
    if (crs_b_c < -EPS)
        return CCW::CLOCKWISE;
    if (dot(b, c) < -EPS)
        return CCW::ONLINE_BACK;
    if (norm(b) + EPS < norm(c))
        return CCW::ONLINE_FRONT;
    return CCW::ON_SEGMENT;
}
polygon convex_hull(polygon p, bool vertices_on_edge_remain = true)
{
    int n = (int)p.size(), k = 0;
    if (n <= 2)
        return p;
    sort(all(p));
    points ch(2 * n);
    if (vertices_on_edge_remain)
    {
        for (int i = 0; i < n; ch[k++] = p[i++])
            while (k >= 2 && ccw(ch[k - 2], ch[k - 1], p[i]) == -1)
                --k;
        for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--])
            while (k >= t && ccw(ch[k - 2], ch[k - 1], p[i]) == -1)
                --k;
    }
    else
    {
        for (int i = 0; i < n; ch[k++] = p[i++])
            while (k >= 2 && ccw(ch[k - 2], ch[k - 1], p[i]) != 1)
                --k;
        for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--])
            while (k >= t && ccw(ch[k - 2], ch[k - 1], p[i]) != 1)
                --k;
    }
    ch.resize(k - 1);
    return ch;
}
void solve()
{
    int n;
    cin >> n;
    if (n == 0)
        exit(0);
    vec<point> a(n);
    rep(i, n)
    {
        R x, y;
        cin >> x >> y;
        a[i] = {x, y};
    }
    auto b = convex_hull(a, true);
    auto c = convex_hull(a, false);
    int m1 = sz(b), m2 = sz(c);
    vec<int> bi(m1), ci(m2);
    rep(i, m1) rep(k, n) if (b[i] == a[k]) bi[i] = k;
    rep(i, m2) rep(k, n) if (c[i] == a[k]) ci[i] = k;
    vec<bool> ce(n);
    for (int i : ci)
        ce[i] = true;
    rep(i, m1)
    {
        int idx1 = bi[(i + 1) % m1], idx2 = bi[i];
        if ((idx1 - idx2 + n) % n == 1)
            continue;
        if (ce[idx1] || ce[idx2])
        {
            cout << "No" << '\n';
            return;
        }
    }
    cout << "Yes" << '\n';
    return;
}
int main()
{
    cin.tie(0)->sync_with_stdio(0), cout.tie(0);
    cout << fixed << setprecision(20);
    int t = 1;
    // cin >> t;
    // while (t--)
    while (true)
        solve();
}
accuracy: 1
time_ms: 30
memory_kb: 3656
final_rank: 12

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end())
#define SZ(v) (int)v.size()
#define MIN(v) *min_element(ALL(v))
#define MAX(v) *max_element(ALL(v))
#define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin())
#define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin())

using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
const int inf = 0x3fffffff;
const ll INF = 0x1fffffffffffffff;

template <typename T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T, typename U> T ceil(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U> T floor(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T> int popcnt(T x) {
    return __builtin_popcountll(x);
}
template <typename T> int topbit(T x) {
    return (x == 0 ? -1 : 63 - __builtin_clzll(x));
}
template <typename T> int lowbit(T x) {
    return (x == 0 ? -1 : __builtin_ctzll(x));
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "P(" << p.first << ", " << p.second << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#ifdef LOCAL
#define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__)
#else
#define show(...) true
#endif
template <typename T> void _show(int i, T name) {
    cerr << '\n';
}
template <typename T1, typename T2, typename... T3>
void _show(int i, const T1 &a, const T2 &b, const T3 &...c) {
    for (; a[i] != ',' && a[i] != '\0'; i++)
        cerr << a[i];
    cerr << ":" << b << " ";
    _show(i + 1, a, c...);
}

/**
 * @brief template
 */

using T = long double;
const T eps = 1e-6;
using Point = complex<T>;
using Poly = vector<Point>;
#define X real()
#define Y imag()
template <typename T> inline bool eq(const T &a, const T &b) {
    return fabs(a - b) < eps;
}
bool cmp(const Point &a, const Point &b) {
    auto sub = [&](Point a) {
        return (a.Y < 0 ? -1 : (a.Y == 0 && a.X >= 0 ? 0 : 1));
    };
    if (sub(a) != sub(b))
        return sub(a) < sub(b);
    return a.Y * b.X < a.X * b.Y;
}
struct Line {
    Point a, b, dir;
    Line() {}
    Line(Point _a, Point _b) : a(_a), b(_b), dir(b - a) {}
    Line(T A, T B, T C) {
        if (eq(A, (T).0)) {
            a = Point(0, C / B), b = Point(1 / C / B);
        } else if (eq(B, (T).0)) {
            a = Point(C / A, 0), b = Point(C / A, 1);
        } else {
            a = Point(0, C / B), b = Point(C / A, 0);
        }
    }
};
struct Segment : Line {
    Segment() {}
    Segment(Point _a, Point _b) : Line(_a, _b) {}
};
struct Circle {
    Point p;
    T r;
    Circle() {}
    Circle(Point _p, T _r) : p(_p), r(_r) {}
};

istream &operator>>(istream &is, Point &p) {
    T x, y;
    is >> x >> y;
    p = Point(x, y);
    return is;
}
ostream &operator<<(ostream &os, Point &p) {
    os << fixed << setprecision(12) << p.X << ' ' << p.Y;
    return os;
}
Point unit(const Point &a) {
    return a / abs(a);
}
T dot(const Point &a, const Point &b) {
    return a.X * b.X + a.Y * b.Y;
}
T cross(const Point &a, const Point &b) {
    return a.X * b.Y - a.Y * b.X;
}
Point rot(const Point &a, const T &theta) {
    return Point(cos(theta) * a.X - sin(theta) * a.Y,
                 sin(theta) * a.X + cos(theta) * a.Y);
}
Point rot90(const Point &a) {
    return Point(-a.Y, a.X);
}
T arg(const Point &a, const Point &b, const Point &c) {
    double ret = acos(dot(a - b, c - b) / abs(a - b) / abs(c - b));
    if (cross(a - b, c - b) < 0)
        ret = -ret;
    return ret;
}

Point Projection(const Line &l, const Point &p) {
    T t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}
Point Projection(const Segment &l, const Point &p) {
    T t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}
Point Reflection(const Line &l, const Point &p) {
    return p + (Projection(l, p) - p) * (T)2.;
}
int ccw(const Point &a, Point b, Point c) {
    b -= a;
    c -= a;
    if (cross(b, c) > eps)
        return 1; // ccw

    if (cross(b, c) < -eps)
        return -1; // cw

    if (dot(b, c) < 0)
        return 2; // c,a,b

    if (norm(b) < norm(c))
        return -2; // a,b,c

    return 0;      // a,c,b

}
bool isOrthogonal(const Line &a, const Line &b) {
    return eq(dot(a.b - a.a, b.b - b.a), (T).0);
}
bool isParallel(const Line &a, const Line &b) {
    return eq(cross(a.b - a.a, b.b - b.a), (T).0);
}
bool isIntersect(const Segment &a, const Segment &b) {
    return ccw(a.a, a.b, b.a) * ccw(a.a, a.b, b.b) <= 0 and
           ccw(b.a, b.b, a.a) * ccw(b.a, b.b, a.b) <= 0;
}
int isIntersect(const Circle &a, const Circle &b) {
    T d = abs(a.p - b.p);
    if (d > a.r + b.r + eps)
        return 4;
    if (eq(d, a.r + b.r))
        return 3;
    if (eq(d, abs(a.r - b.r)))
        return 1;
    if (d < abs(a.r - b.r) - eps)
        return 0;
    return 2;
}
T Dist(const Line &a, const Point &b) {
    Point c = Projection(a, b);
    return abs(c - b);
}
T Dist(const Segment &a, const Point &b) {
    if (dot(a.b - a.a, b - a.a) < eps)
        return abs(b - a.a);
    if (dot(a.a - a.b, b - a.b) < eps)
        return abs(b - a.b);
    return abs(cross(a.b - a.a, b - a.a)) / abs(a.b - a.a);
}
T Dist(const Segment &a, const Segment &b) {
    if (isIntersect(a, b))
        return (T).0;
    T res = min({Dist(a, b.a), Dist(a, b.b), Dist(b, a.a), Dist(b, a.b)});
    return res;
}
Point Intersection(const Line &a, const Line &b) {
    T d1 = cross(a.b - a.a, b.b - b.a);
    T d2 = cross(a.b - a.a, a.b - b.a);
    if (eq(d1, (T)0.) and eq(d2, (T)0.))
        return b.a;
    return b.a + (b.b - b.a) * (d2 / d1);
}
Poly Intersection(const Circle &a, const Line &b) {
    Poly res;
    T d = Dist(b, a.p);
    if (d > a.r + eps)
        return res;
    Point h = Projection(b, a.p);
    if (eq(d, a.r)) {
        res.push_back(h);
        return res;
    }
    Point e = unit(b.b - b.a);
    T ph = sqrt(a.r * a.r - d * d);
    res.push_back(h - e * ph);
    res.push_back(h + e * ph);
    return res;
}
Poly Intersection(const Circle &a, const Segment &b) {
    Line c(b.a, b.b);
    Poly sub = Intersection(a, c);
    double xmi = min(b.a.X, b.b.X), xma = max(b.a.X, b.b.X);
    double ymi = min(b.a.Y, b.b.Y), yma = max(b.a.Y, b.b.Y);
    Poly res;
    rep(i, 0, sub.size()) {
        if (xmi <= sub[i].X + eps and sub[i].X - eps <= xma and
            ymi <= sub[i].Y + eps and sub[i].Y - eps <= yma) {
            res.push_back(sub[i]);
        }
    }
    return res;
}
Poly Intersection(const Circle &a, const Circle &b) {
    Poly res;
    int mode = isIntersect(a, b);
    T d = abs(a.p - b.p);
    if (mode == 4 or mode == 0)
        return res;
    if (mode == 3) {
        T t = a.r / (a.r + b.r);
        res.push_back(a.p + (b.p - a.p) * t);
        return res;
    }
    if (mode == 1) {
        if (b.r < a.r - eps) {
            res.push_back(a.p + (b.p - a.p) * (a.r / d));
        } else {
            res.push_back(b.p + (a.p - b.p) * (b.r / d));
        }
        return res;
    }
    T rc = (a.r * a.r + d * d - b.r * b.r) / d / (T)2.;
    T rs = sqrt(a.r * a.r - rc * rc);
    if (a.r - abs(rc) < eps)
        rs = 0;
    Point e = unit(b.p - a.p);
    res.push_back(a.p + rc * e + rs * e * Point(0, 1));
    res.push_back(a.p + rc * e + rs * e * Point(0, -1));
    return res;
}
Poly HalfplaneIntersection(vector<Line> &H) {
    sort(ALL(H), [&](Line &l1, Line &l2) { return cmp(l1.dir, l2.dir); });
    auto outside = [&](Line &L, Point p) -> bool {
        return cross(L.dir, p - L.a) < -eps;
    };
    deque<Line> deq;
    int sz = 0;
    rep(i, 0, SZ(H)) {
        while (sz > 1 and
               outside(H[i], Intersection(deq[sz - 1], deq[sz - 2]))) {
            deq.pop_back();
            sz--;
        }
        while (sz > 1 and outside(H[i], Intersection(deq[0], deq[1]))) {
            deq.pop_front();
            sz--;
        }
        if (sz > 0 and fabs(cross(H[i].dir, deq[sz - 1].dir)) < eps) {
            if (dot(H[i].dir, deq[sz - 1].dir) < 0) {
                return {};
            }
            if (outside(H[i], deq[sz - 1].a)) {
                deq.pop_back();
                sz--;
            } else
                continue;
        }
        deq.push_back(H[i]);
        sz++;
    }

    while (sz > 2 and outside(deq[0], Intersection(deq[sz - 1], deq[sz - 2]))) {
        deq.pop_back();
        sz--;
    }
    while (sz > 2 and outside(deq[sz - 1], Intersection(deq[0], deq[1]))) {
        deq.pop_front();
        sz--;
    }
    if (sz < 3)
        return {};
    deq.push_back(deq.front());
    Poly ret;
    rep(i, 0, sz) ret.push_back(Intersection(deq[i], deq[i + 1]));
    return ret;
}

T Area(const Poly &a) {
    T res = 0;
    int n = a.size();
    rep(i, 0, n) res += cross(a[i], a[(i + 1) % n]);
    return fabs(res / (T)2.);
}
T Area(const Poly &a, const Circle &b) {
    int n = a.size();
    if (n < 3)
        return (T).0;
    auto rec = [&](auto self, const Circle &c, const Point &p1,
                   const Point &p2) {
        Point va = c.p - p1, vb = c.p - p2;
        T f = cross(va, vb), res = (T).0;
        if (eq(f, (T).0))
            return res;
        if (max(abs(va), abs(vb)) < c.r + eps)
            return f;
        if (Dist(Segment(p1, p2), c.p) > c.r - eps)
            return c.r * c.r * arg(vb * conj(va));
        auto u = Intersection(c, Segment(p1, p2));
        Poly sub;
        sub.push_back(p1);
        for (auto &x : u)
            sub.push_back(x);
        sub.push_back(p2);
        rep(i, 0, sub.size() - 1) res += self(self, c, sub[i], sub[i + 1]);
        return res;
    };
    T res = (T).0;
    rep(i, 0, n) res += rec(rec, b, a[i], a[(i + 1) % n]);
    return fabs(res / (T)2.);
}
T Area(const Circle &a, const Circle &b) {
    T d = abs(a.p - b.p);
    if (d >= a.r + b.r - eps)
        return (T).0;
    if (d <= abs(a.r - b.r) + eps) {
        T r = min(a.r, b.r);
        return M_PI * r * r;
    }
    T ath = acos((a.r * a.r + d * d - b.r * b.r) / d / a.r / (T)2.);
    T res = a.r * a.r * (ath - sin(ath * 2) / (T)2.);
    T bth = acos((b.r * b.r + d * d - a.r * a.r) / d / b.r / (T)2.);
    res += b.r * b.r * (bth - sin(bth * 2) / (T)2.);
    return fabs(res);
}
bool isConvex(const Poly &a) {
    int n = a.size();
    int cur, pre, nxt;
    rep(i, 0, n) {
        pre = (i - 1 + n) % n;
        nxt = (i + 1) % n;
        cur = i;
        if (ccw(a[pre], a[cur], a[nxt]) == -1)
            return 0;
    }
    return 1;
}
int isContained(const Poly &a,
                const Point &b) { // 0:not contain,1:on edge,2:contain

    bool res = 0;
    int n = a.size();
    rep(i, 0, n) {
        Point p = a[i] - b, q = a[(i + 1) % n] - b;
        if (p.Y > q.Y)
            swap(p, q);
        if (p.Y < eps and eps < q.Y and cross(p, q) > eps)
            res ^= 1;
        if (eq(cross(p, q), (T).0) and dot(p, q) < eps)
            return 1;
    }
    return (res ? 2 : 0);
}
Poly ConvexHull(Poly &a) {
    sort(ALL(a), [](const Point &p, const Point &q) {
        return (eq(p.Y, q.Y) ? p.X < q.X : p.Y < q.Y);
    });
    a.erase(unique(ALL(a)), a.end());
    int n = a.size(), k = 0;
    Poly res(n * 2);
    for (int i = 0; i < n; res[k++] = a[i++]) {
        while (k >= 2 and
               cross(res[k - 1] - res[k - 2], a[i] - res[k - 1]) < eps)
            k--;
    }
    for (int i = n - 2, t = k + 1; i >= 0; res[k++] = a[i--]) {
        while (k >= t and
               cross(res[k - 1] - res[k - 2], a[i] - res[k - 1]) < eps)
            k--;
    }
    res.resize(k - 1);
    return res;
}
T Diam(const Poly &a) {
    int n = a.size();
    int x = 0, y = 0;
    rep(i, 1, n) {
        if (a[i].Y > a[x].Y)
            x = i;
        if (a[i].Y < a[y].Y)
            y = i;
    }
    T res = abs(a[x] - a[y]);
    int i = x, j = y;
    do {
        if (cross(a[(i + 1) % n] - a[i], a[(j + 1) % n] - a[j]) < 0)
            i = (i + 1) % n;
        else
            j = (j + 1) % n;
        chmax(res, abs(a[i] - a[j]));
    } while (i != x or j != y);
    return res;
}
Poly Cut(const Poly &a, const Line &l) {
    int n = a.size();
    Poly res;
    rep(i, 0, n) {
        Point p = a[i], q = a[(i + 1) % n];
        if (ccw(l.a, l.b, p) != -1)
            res.push_back(p);
        if (ccw(l.a, l.b, p) * ccw(l.a, l.b, q) < 0)
            res.push_back(Intersection(Line(p, q), l));
    }
    return res;
}

T Closest(Poly &a) {
    int n = a.size();
    if (n <= 1)
        return 0;
    sort(ALL(a), [&](Point a, Point b) {
        return (eq(a.X, b.X) ? a.Y < b.Y : a.X < b.X);
    });
    Poly buf(n);
    auto rec = [&](auto self, int lb, int rb) -> T {
        if (rb - lb <= 1)
            return (T)INF;
        int mid = (lb + rb) >> 1;
        auto x = a[mid].X;
        T res = min(self(self, lb, mid), self(self, mid, rb));
        inplace_merge(a.begin() + lb, a.begin() + mid, a.begin() + rb,
                      [&](auto p, auto q) { return p.Y < q.Y; });
        int ptr = 0;
        rep(i, lb, rb) {
            if (abs(a[i].X - x) >= res)
                continue;
            rep(j, 0, ptr) {
                auto sub = a[i] - buf[ptr - 1 - j];
                if (sub.Y >= res)
                    break;
                chmin(res, abs(sub));
            }
            buf[ptr++] = a[i];
        }
        return res;
    };
    return rec(rec, 0, n);
}

Circle Incircle(const Point &a, const Point &b, const Point &c) {
    T A = abs(b - c), B = abs(c - a), C = abs(a - b);
    Point p(A * a.X + B * b.X + C * c.X, A * a.Y + B * b.Y + C * c.Y);
    p /= (A + B + C);
    T r = Dist(Line(a, b), p);
    return Circle(p, r);
}
Circle Circumcircle(const Point &a, const Point &b, const Point &c) {
    Line l1((a + b) / (T)2., (a + b) / (T)2. + (b - a) * Point(0, 1));
    Line l2((b + c) / (T)2., (b + c) / (T)2. + (c - b) * Point(0, 1));
    Point p = Intersection(l1, l2);
    return Circle(p, abs(p - a));
}
Poly tangent(const Point &a, const Circle &b) {
    return Intersection(b, Circle(a, sqrt(norm(b.p - a) - b.r * b.r)));
}
vector<Line> tangent(const Circle &a, const Circle &b) {
    vector<Line> res;
    T d = abs(a.p - b.p);
    if (eq(d, (T)0.))
        return res;
    Point u = unit(b.p - a.p);
    Point v = u * Point(0, 1);
    for (int t : {-1, 1}) {
        T h = (a.r + b.r * t) / d;
        if (eq(h * h, (T)1.)) {
            res.push_back(Line(a.p + (h > 0 ? u : -u) * a.r,
                               a.p + (h > 0 ? u : -u) * a.r + v));
        } else if (1 > h * h) {
            Point U = u * h, V = v * sqrt(1 - h * h);
            res.push_back(Line(a.p + (U + V) * a.r, b.p - (U + V) * (b.r * t)));
            res.push_back(Line(a.p + (U - V) * a.r, b.p - (U - V) * (b.r * t)));
        }
    }
    return res;
}

/**
 * @brief Geometry
 */

int main() {
while(1) {
    int N;
    cin >> N;
    if (N == 0) return 0;
    Poly P(N);
    rep(i,0,N) {
        long double x, y;
        cin >> x >> y;
        P[i] = Point(x,y);
    }
    auto Q = P;
    Q = ConvexHull(Q);
    auto ison = [&](Point R) -> bool {
        rep(i,0,N) {
            if (ccw(P[i],P[(i+1)%N],R) == 0) return true;
        }
        return false;
    };
    int M = Q.size();
    bool check = true;
    rep(i,0,M) {
        Point R1 = Q[i], R2 = Q[(i+1)%M];
        Point V = unit(R2-R1) * 0.5L;
        if (!ison(R1+V)) check = false;
        if (!ison(R2-V)) check = false;
    }
    cout << (check ? "Yes" : "No") << endl;
}
}
accuracy: 1
time_ms: 70
memory_kb: 3532
final_rank: 11

code_snippet: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef pair<ll,ll> pi;
typedef pair<ll,pi> ppi;
#define FOR(i,l,r) for(ll i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,l,r) for(ll i=r-1;i>=l;i--)
#define RREP(i,n) RFOR(i,0,n)
#define sz(A) (ll)(A.size())
#define ALL(A) A.begin(),A.end()
#define LB(A,x) (ll)(lower_bound(ALL(A),x)-A.begin())
#define UB(A,x) (ll)(upper_bound(ALL(A),x)-A.begin())
#define COU(A,x) (UB(A,x)-LB(A,x))
#define F first
#define S second
template<typename T>using min_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<typename T1,typename T2>ostream&operator<<(ostream&os,pair<T1,T2>&p){os<<p.F<<" "<<p.S;return os;}
template<typename T1,typename T2>istream&operator>>(istream&is,pair<T1,T2>&p){is>>p.F>>p.S;return is;}
template<typename T>ostream&operator<<(ostream&os,vector<T>&v){REP(i,sz(v))os<<v[i]<<(i+1!=sz(v)?" ":"");return os;}
template<typename T>istream&operator>>(istream&is,vector<T>&v){for(T&in:v)is>>in;return is;}
template<class T>bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T&a,T b){if(b<a){a=b;return 1;}return 0;}
const ll mod=998244353;
pi diff(pi a,pi b){return pi(a.F-b.F,a.S-b.S);}
int main(){
    while(1){
        int N;cin>>N;
        if(!N)return 0;
        vector<pi>A(N);cin>>A;
        map<pi,ll>memo;
        REP(i,N)memo[A[i]]=i;
        stack<pi>st;
        auto B=A;
        sort(ALL(B));
        st.emplace(B[0]);
        st.emplace(B[1]);
        FOR(i,2,N){
            while(sz(st)>1){
                auto p=st.top();st.pop();
                auto q=st.top();
                auto a=diff(p,q);
                auto b=diff(B[i],q);
                if(b.F*a.S<a.F*b.S){
                    st.emplace(p);break;
                }
            }
            st.emplace(B[i]);
        }
        vector<pi>C;
        while(sz(st)){
            C.emplace_back(st.top());
            st.pop();
        }
        st.emplace(B[N-1]);
        st.emplace(B[N-2]);
        RREP(i,N-2){
            while(sz(st)>1){
                auto p=st.top();st.pop();
                auto q=st.top();
                auto a=diff(p,q);
                auto b=diff(B[i],q);
                if(b.F*a.S<a.F*b.S){
                    st.emplace(p);break;
                }
            }
            st.emplace(B[i]);
        }
        {
            vector<pi>_C;
            while(sz(st)){
                _C.emplace_back(st.top());st.pop();
            }
            reverse(ALL(C));
            reverse(ALL(_C));
            FOR(i,1,sz(_C))C.emplace_back(_C[i]);
        }
        C.emplace_back(C[1]);
        A.emplace_back(A[0]);
        A.emplace_back(A[1]);
        bool ok=1;
        REP(i,sz(C)-2){
            //C[i]->C[i+1]->C[i+2]がぽり
            auto j=memo[C[i+1]];
            j=(j+N-1)%N;
            //A[j]->A[j+1]->A[j+2]
            //cout<<C[i]<<" -> "<<C[i+1]<<" -> "<<C[i+2]<<endl;
            //cout<<A[j]<<" -> "<<A[j+1]<<" -> "<<A[j+2]<<endl;
            auto a=diff(C[i],C[i+1]),b=diff(A[j],A[j+1]);
            if(a.S*b.F!=a.F*b.S)ok=0;
            a=diff(C[i+2],C[i+1]),b=diff(A[j+2],A[j+1]);
            if(a.S*b.F!=a.F*b.S)ok=0;
        }
        if(ok)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 3440
final_rank: 4

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, a, b) for(ll i = a; i < b; ++i)
#define rrep(i, a, b) for(ll i = a; i >= b; --i)
constexpr ll inf = 4e18;
struct SetupIO {
    SetupIO() {
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout << fixed << setprecision(30);
    }
} setup_io;
using Real = long double;
const Real EPS = Real(1e-8), PI = acos(Real(-1.0));
int sign(const Real& r) {
    if(r <= -EPS) return -1;
    if(r >= +EPS) return +1;
    return 0;
}
bool eq(const Real& a, const Real& b) {
    return sign(a - b) == 0;
}
using Point = complex<Real>;
istream& operator>>(istream& is, Point& p) {
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}
ostream& operator<<(ostream& os, const Point& p) {
    return os << p.real() << " " << p.imag();
}
Point operator*(const Point& p, const Real& d) {
    return Point(p.real() * d, p.imag() * d);
}
Point operator/(const Point& p, const Real& d) {
    return Point(p.real() / d, p.imag() / d);
}
Point rot(const Point& p, const Real& theta) {
    return p * Point(cos(theta), sin(theta));
}
Real dot(const Point& p1, const Point& p2) {
    return (conj(p1) * p2).real();
}
Real cross(const Point& p1, const Point& p2) {
    return (conj(p1) * p2).imag();
}
Real dist(const Point& p1, const Point& p2) {
    return abs(p1 - p2);
}
bool comp_x(const Point& p1, const Point& p2) {
    return eq(p1.real(), p2.real()) ? p1.imag() < p2.imag() : p1.real() < p2.real();
}
bool comp_y(const Point& p1, const Point& p2) {
    return eq(p1.imag(), p2.imag()) ? p1.real() < p2.real() : p1.imag() < p2.imag();
}
bool comp_arg(const Point& p1, const Point& p2) {
    return arg(p1) < arg(p2);
}
int ccw(const Point& a, Point b, Point c) {
    b -= a;
    c -= a;
    if(sign(cross(b, c)) == 1) return 1;
    if(sign(cross(b, c)) == -1) return -1;
    if(sign(dot(b, c)) == -1) return +2;
    if(norm(b) < norm(c)) return -2;
    return 0;
}
Real closest_pair(vector<Point> ps) {
    if((int)ps.size() <= 1) return Real(1e18);
    sort(ps.begin(), ps.end(), comp_x);
    vector<Point> memo(ps.size());
    auto func = [&](auto& func, int l, int r) -> Real {
        if(r - l <= 1) return Real(1e18);
        int m = (l + r) >> 1;
        Real x = ps[m].real();
        Real res = min(func(func, l, m), func(func, m, r));
        inplace_merge(ps.begin() + l, ps.begin() + m, ps.begin() + r, comp_y);
        int cnt = 0;
        for(int i = l; i < r; ++i) {
            if(abs(ps[i].real() - x) >= res) continue;
            for(int j = 0; j < cnt; ++j) {
                Point d = ps[i] - memo[cnt - j - 1];
                if(d.imag() >= res) break;
                res = min(res, abs(d));
            }
            memo[cnt++] = ps[i];
        }
        return res;
    };
    return func(func, 0, (int)ps.size());
}
struct Line {
    Point a, b;
    Line() = default;
    Line(const Point& a, const Point& b)
        : a(a), b(b) {}
};
using Segment = Line;
bool is_parallel(const Line& a, const Line& b) {
    return eq(cross(a.b - a.a, b.b - b.a), 0.0);
}
bool is_orthogonal(const Line& a, const Line& b) {
    return eq(dot(a.b - a.a, b.b - b.a), 0.0);
}
Point projection(const Line& l, const Point& p) {
    Real t = dot(p - l.a, l.b - l.a) / norm(l.b - l.a);
    return l.a + (l.b - l.a) * t;
}
Point reflection(const Line& l, const Point& p) {
    return p + (projection(l, p) - p) * 2.0;
}
bool is_intersect_lp(const Line& l, const Point& p) {
    return abs(ccw(l.a, l.b, p)) != 1;
}
bool is_intersect_sp(const Segment& s, const Point& p) {
    return ccw(s.a, s.b, p) == 0;
}
bool is_intersect_ll(const Line& l1, const Line& l2) {
    if(!eq(cross(l1.b - l1.a, l2.b - l2.a), 0.0)) return true;
    return eq(cross(l1.b - l1.a, l2.b - l1.a), 0.0);
}
bool is_intersect_ls(const Line& l, const Segment& s) {
    return sign(cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a)) <= 0;
}
bool is_intersect_sl(const Segment& s, const Line& l) {
    return is_intersect_ls(l, s);
}
bool is_intersect_ss(const Segment& s1, const Segment& s2) {
    if(ccw(s1.a, s1.b, s2.a) * ccw(s1.a, s1.b, s2.b) > 0) return false;
    return ccw(s2.a, s2.b, s1.a) * ccw(s2.a, s2.b, s1.b) <= 0;
}
vector<Point> intersection_ll(const Line& l1, const Line& l2) {
    vector<Point> res;
    if(!is_intersect_ll(l1, l2)) return res;
    Real a = cross(l1.b - l1.a, l2.b - l2.a);
    Real b = cross(l1.b - l1.a, l1.b - l2.a);
    if(eq(a, 0.0) and eq(b, 0.0)) {
        res.emplace_back(l2.a);
    } else {
        res.emplace_back(l2.a + (l2.b - l2.a) * b / a);
    }
    return res;
}
vector<Point> intersection_ss(const Segment& s1, const Segment& s2) {
    return is_intersect_ss(s1, s2) ? intersection_ll(Line(s1), Line(s2)) : vector<Point>();
}
Real dist_lp(const Line& l, const Point& p) {
    return abs(p - projection(l, p));
}
Real dist_sp(const Segment& s, const Point& p) {
    const Point h = projection(s, p);
    if(is_intersect_sp(s, h)) return abs(h - p);
    return min(abs(s.a - p), abs(s.b - p));
}
Real dist_ll(const Line& l1, const Line& l2) {
    if(is_intersect_ll(l1, l2)) return 0.0;
    return dist_lp(l1, l2.a);
}
Real dist_ss(const Segment& s1, const Segment& s2) {
    if(is_intersect_ss(s1, s2)) return 0.0;
    return min({dist_sp(s1, s2.a), dist_sp(s1, s2.b), dist_sp(s2, s1.a), dist_sp(s2, s1.b)});
}
Real dist_ls(const Line& l, const Segment& s) {
    if(is_intersect_ls(l, s)) return 0.0;
    return min(dist_lp(l, s.a), dist_lp(l, s.b));
}
Real dist_sl(const Segment& s, const Line& l) {
    return dist_ls(l, s);
}
Real area(const vector<Point>& polygon) {
    Real res = 0.0;
    const int n = (int)polygon.size();
    for(int i = 0; i < n; ++i) {
        res += cross(polygon[i], polygon[(i + 1) % n]);
    }
    return abs(res * 0.5);
}
bool is_convex(const vector<Point>& polygon) {
    const int n = (int)polygon.size();
    for(int i = 0; i < n; ++i) {
        if(ccw(polygon[(i - 1 + n) % n], polygon[i], polygon[(i + 1) % n]) == -1) return false;
    }
    return true;
}
int in_polygon(const vector<Point>& polygon, const Point& p) {
    const int n = (int)polygon.size();
    int ret = 0;
    for(int i = 0; i < n; ++i) {
        Point a = polygon[i] - p, b = polygon[(i + 1) % n] - p;
        if(eq(cross(a, b), 0.0) and sign(dot(a, b)) <= 0) return 1;
        if(a.imag() > b.imag()) swap(a, b);
        if(sign(a.imag()) <= 0 and sign(b.imag()) == 1 and sign(cross(a, b)) == 1) ret ^= 2;
    }
    return ret;
}
vector<Point> convex_hull(vector<Point> ps) {
    sort(ps.begin(), ps.end(), comp_x);
    ps.erase(unique(ps.begin(), ps.end()), ps.end());
    int n = (int)ps.size(), k = 0;
    if(n == 1) return ps;
    vector<Point> ch(2 * n);
    for(int i = 0; i < n; ch[k++] = ps[i++]) {
        while(k >= 2 and sign(cross(ch[k - 1] - ch[k - 2], ps[i] - ch[k - 1])) == -1) {
            --k;
        }
    }
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]) {
        while(k >= t and sign(cross(ch[k - 1] - ch[k - 2], ps[i] - ch[k - 1])) == -1) {
            --k;
        }
    }
    ch.resize(k - 1);
    return ch;
}
Real convex_diameter(const vector<Point>& polygon) {
    int n = (int)polygon.size(), is = 0, js = 0;
    for(int i = 1; i < n; ++i) {
        if(sign(polygon[i].imag() - polygon[is].imag()) == 1) is = i;
        if(sign(polygon[i].imag() - polygon[js].imag()) == -1) js = i;
    }
    Real maxdis = norm(polygon[is] - polygon[js]);
    int i = is, j = js;
    do {
        if(sign(cross(polygon[(i + 1) % n] - polygon[i], polygon[(j + 1) % n] - polygon[j])) >= 0) {
            j = (j + 1) % n;
        } else {
            i = (i + 1) % n;
        }
        if(norm(polygon[i] - polygon[j]) > maxdis) {
            maxdis = norm(polygon[i] - polygon[j]);
        }
    } while(i != is or j != js);
    return sqrt(maxdis);
}
vector<Point> convex_cut(const vector<Point>& polygon, const Line& l) {
    const int n = (int)polygon.size();
    vector<Point> res;
    for(int i = 0; i < n; ++i) {
        const Point cur = polygon[i], nex = polygon[(i + 1) % n];
        if(ccw(l.a, l.b, cur) != -1) res.emplace_back(cur);
        if(ccw(l.a, l.b, cur) * ccw(l.a, l.b, nex) < 0) {
            res.emplace_back(intersection_ll(Line(cur, nex), l)[0]);
        }
    }
    return res;
}

int main(void) {
    while(1) {
        int n;
        cin >> n;
        if(n == 0) break;

        vector<Point> poly(n);
        rep(i, 0, n) {
            cin >> poly[i];
        }

        vector<Point> ch = convex_hull(poly);

        bool ok = true;
        rep(i, 0, n) {
            Point p = poly[i];
            if(in_polygon(ch, p) == 2) {
                int l1 = i; int r1 = i;
                while(in_polygon(ch, poly[l1]) != 1) {
                    l1 = (l1-1 + n) % n;
                }
                while(in_polygon(ch, poly[r1]) != 1) {
                    r1 = (r1+1) % n;
                }

                int l2 = (l1-1+n) % n; int r2 = (r1+1) % n;
                while(in_polygon(ch, poly[l2]) != 1) {
                    l2 = (l2-1 + n) % n;
                }
                while(in_polygon(ch, poly[r2]) != 1) {
                    r2 = (r2+1) % n;
                }
                if(!is_parallel(Line(poly[l1], poly[r1]), Line(poly[l1], poly[l2]))) ok = false;
                if(!is_parallel(Line(poly[l1], poly[r1]), Line(poly[r1], poly[r2]))) ok = false;
            }
        }

        if(ok) cout << "Yes\n";
        else cout << "No\n";
    }
}
accuracy: 1
time_ms: 1370
memory_kb: 3524
final_rank: 14

code_snippet: #include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,s,t) for(ll i=s;i<(ll)(t);i++)
#define rrep(i,s,t) for(ll i=(ll)(t)-1;i>=(ll)s;i--)
#define all(x) begin(x),end(x)
#define rall(x) rbegin(x),rend(x)

#define TT template<typename T>
TT using vec=vector<T>;
TT bool chmin(T &x,T y){return x>y?(x=y,true):false;}
TT bool chmax(T &x,T y){return x<y?(x=y,true):false;}

struct io_setup{
    io_setup(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        cout<<fixed<<setprecision(15);
    }
} io_setup;

using Point = complex<ll>;
using Polygon = vector<Point>;

double dot(const Point &a, const Point &b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}

double cross(const Point &a, const Point &b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

int counter_clockwise(const Point &p2, Point p0, Point p1) {
    // 反時計回り
    if (cross(p1 - p0, p2 - p0) > 0) {
        return 1;
    }
    // 時計回り
    if (cross(p1 - p0, p2 - p0) < 0) {
        return -1;
    }
    // p2, p0, p1 の順で同一直線上
    if (dot(p1 - p0, p2 - p0) < 0) {
        return 2;
    }
    // p0, p1, p2 の順で同一直線上
    if (dot(p1 - p0, p2 - p0) > norm(p1 - p0)) {
        return -2;
    }
    // p2 は p0 と p1 を結ぶ線分上
    return 0;
}

Polygon convex_hull(vector<Point> &ps) {
    int N = ps.size();
    auto compare = [](const Point &p1, const Point &p2) {
        if (p1.real() != p2.real()) return p1.real() < p2.real();
        return p1.imag() < p2.imag();
    };
    sort(ps.begin(), ps.end(), compare);
    int k = 0;
    Polygon qs(2 * N);
    // 下側凸包
    for (int i = 0; i < N; i++) {
        while (k > 1 && cross(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) <= 0) k--;
        qs[k++] = ps[i];
    }
    // 上側凸包
    for (int i = N - 2, t = k; i >= 0; i--) {
        while (k > t && cross(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) <= 0) k--;
        qs[k++] = ps[i];
    }
    qs.resize(k - 1);
    return qs;
}

int solve(){
    int N;
    cin>>N;
    if(N==0)return 0;
    vector<ll>X(N),Y(N);
    for(int i=0;i<N;i++)cin>>X[i]>>Y[i];
    vector<Point>vp(N);
    for(int i=0;i<N;i++)vp[i]=Point(X[i],Y[i]);
    Polygon pl=convex_hull(vp);
    int L=pl.size();
    for(int i=0;i<L;i++){
        bool ok=true;
        for(int j=0;j<N;j++){
            if(abs(counter_clockwise(Point(X[j],Y[j]),pl[i],pl[(i+1)%L]))==1
            &&counter_clockwise(Point(X[(j+1)%N],Y[(j+1)%N]),pl[i],pl[(i+1)%L])==0
            &&abs(counter_clockwise(Point(X[(j+2)%N],Y[(j+2)%N]),pl[i],pl[(i+1)%L]))==1){
                ok=false;
                break;
            }
        }
        if(!ok){
            cout<<"No"<<endl;
            return 1;
        }
    }
    cout<<"Yes"<<endl;
    return 1;
}

int main(){
    while(solve());
}
accuracy: 1
time_ms: 20
memory_kb: 3460
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define all(A) A.begin(),A.end()
#define ALL(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
template<class T>
bool chmax(T& p, T q, bool C = 1) {
    if (C == 0 && p == q) {
        return 1;
    }
    if (p < q) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

template<class T>
bool chmin(T& p, T q, bool C = 1) {
    if (C == 0 && p == q) {
        return 1;
    }
    if (p > q) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

#include<complex>
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 };

struct IOSetup {
    IOSetup() {
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout << fixed << setprecision(12);
    }
} iosetup;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < (int)v.size(); i++) os << v[i] << (i + 1 == (int)v.size() ? "" : " ");
    return os;
}
template<typename T>
istream& operator>>(istream& is, vector<T>& v) {
    for (T& x : v)is >> x;
    return is;
}

// line 1 "Geometry/template.cpp"
// Real
using Real = double;
const Real EPS = 1e-6;
const Real pi = acosl(-1);

// Point
using Point = complex<Real>;
istream& operator>>(istream& is, Point& p) {
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}
ostream& operator<<(ostream& os, Point& p) {
    return os << fixed << setprecision(12) << p.real() << ' ' << p.imag();
}
inline bool eq(Real a, Real b) {
    return fabs(a - b) < EPS;
}
Point operator*(const Point& p, const Real& d) {
    return Point(real(p) * d, imag(p) * d);
}

// Line
struct Line {
    Point p1, p2;
    Line() = default;
    Line(Point p1, Point p2) :p1(p1), p2(p2) {}
    //Ax + By = C
    Line(Real A, Real B, Real C) {
        if (eq(A, 0))     p1 = Point(0, C / B), p2 = Point(1, C / B);
        else if (eq(B, 0))p1 = Point(C / A, 0), p2 = Point(C / A, 1);
        else            p1 = Point(0, C / B), p2 = Point(C / A, 0);
    }
};

// Segment
struct Segment :Line {
    Segment() = default;
    Segment(Point p1, Point p2) :Line(p1, p2) {}
};
Real dot(Point a, Point b) {
    return real(a) * real(b) + imag(a) * imag(b);
}
Real cross(Point a, Point b) {
    return real(a) * imag(b) - imag(a) * real(b);
}
int ccw(Point a, Point b, Point c) {
    b -= a; c -= a;
    if (cross(b, c) > EPS)       return  1;//COUNTER CLOCKWISE
    else if (cross(b, c) < -EPS) return -1;//CLOCKWISE
    else if (dot(b, c) < 0)      return  2;//c--a--b ONLINE BACK
    else if (norm(b) < norm(c)) return -2;//a--b--c ONLINE FRONT
    else                     return  0;//a--c--b ON SEGMENT
}
Point projection(Segment l, Point p) {
    Real k = dot(l.p1 - l.p2, p - l.p1) / norm(l.p1 - l.p2);
    return l.p1 + (l.p1 - l.p2) * k;
}
bool intersect(Segment s, Segment t) {
    return ccw(s.p1, s.p2, t.p1) * ccw(s.p1, s.p2, t.p2) < 0 && ccw(t.p1, t.p2, s.p1) * ccw(t.p1, t.p2, s.p2) <0;
}
bool intersect(Segment s, Point p) {
    return ccw(s.p1, s.p2, p) == 0;
}
Real dis(Point a, Point b) {
    return abs(a - b);
}
Real dis(Segment s, Point p) {
    Point r = projection(s, p);
    if (intersect(s, r)) return abs(r - p);
    return min(abs(s.p1 - p), abs(s.p2 - p));
}

int contains(vector<Point> P, Point p) {
    int res = 0;
    int n = (int)P.size();
    for (int i = 0; i < n; i++) {
        Point a = P[i] - p, b = P[(i + 1) % n] - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b) && cross(a, b) < 0) res ^= 1;
        if (eq(cross(a, b), 0) && (dot(a, b) < 0 || eq(dot(a, b), 0))) return 1;
    }
    if (res) res = 2;
    return res;
}

vector<Point> convex_hull(vector<Point> p) {
    int n = (int)p.size(), k = 0;
    // if (n <= 2)return p;
    sort(begin(p), end(p), [](Point a, Point b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
        });
    vector<Point>ch(2 * n);
    for (int i = 0; i < n; ch[k++] = p[i++]) {
        while(k>=2 and cross(ch[k-1]-ch[k-2],p[i]-ch[k-1])<EPS)k--;
        // while (k >= 2 && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0)k--;
    }
    for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--]) {
        while(k>=t and cross(ch[k-1]-ch[k-2],p[i]-ch[k-1])<EPS)k--;
        // while (k >= t && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0)k--;
    }
    ch.resize(k - 1);
    return ch;
}


void solve(ll N) {

    vector<Point> P(N);
    rep(i, N)cin >> P[i];
    auto C = convex_hull(P);
    ll CN = C.size();
    // cout<<CN<<endl;
    bool OK = 1;
    rep(i, CN) {
        Point P1 = C[i];
        Point P2 = C[(i + 1) % CN];
        double d = dis(P1, P2);
        Point R = P1 + 0.5 / d * (P2 - P1);
        if (contains(P, R) == 0)OK = 0;
        R = P2 + 0.5 / d * (P1 - P2);
        if (contains(P, R) == 0)OK = 0;
    }
    cout << (OK ? "Yes" : "No") << endl;
}


int main() {

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll N;
    while (cin >> N, N != 0)solve(N);

}
accuracy: 1
time_ms: 40
memory_kb: 3480
final_rank: 8

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, a, b) for(ll i = a; i < b; ++i)
#define rrep(i, a, b) for(ll i = a; i >= b; --i)
constexpr ll inf = 4e18;
struct SetupIO {
    SetupIO() {
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout << fixed << setprecision(30);
    }
} setup_io;
using Real = long double;
const Real EPS = Real(1e-8), PI = acos(Real(-1.0));
int sign(const Real& r) {
    if(r <= -EPS) return -1;
    if(r >= +EPS) return +1;
    return 0;
}
bool eq(const Real& a, const Real& b) {
    return sign(a - b) == 0;
}
using Point = complex<Real>;
istream& operator>>(istream& is, Point& p) {
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}
ostream& operator<<(ostream& os, const Point& p) {
    return os << p.real() << " " << p.imag();
}
Point operator*(const Point& p, const Real& d) {
    return Point(p.real() * d, p.imag() * d);
}
Point operator/(const Point& p, const Real& d) {
    return Point(p.real() / d, p.imag() / d);
}
Point rot(const Point& p, const Real& theta) {
    return p * Point(cos(theta), sin(theta));
}
Real dot(const Point& p1, const Point& p2) {
    return (conj(p1) * p2).real();
}
Real cross(const Point& p1, const Point& p2) {
    return (conj(p1) * p2).imag();
}
Real dist(const Point& p1, const Point& p2) {
    return abs(p1 - p2);
}
bool comp_x(const Point& p1, const Point& p2) {
    return eq(p1.real(), p2.real()) ? p1.imag() < p2.imag() : p1.real() < p2.real();
}
bool comp_y(const Point& p1, const Point& p2) {
    return eq(p1.imag(), p2.imag()) ? p1.real() < p2.real() : p1.imag() < p2.imag();
}
bool comp_arg(const Point& p1, const Point& p2) {
    return arg(p1) < arg(p2);
}
int ccw(const Point& a, Point b, Point c) {
    b -= a;
    c -= a;
    if(sign(cross(b, c)) == 1) return 1;
    if(sign(cross(b, c)) == -1) return -1;
    if(sign(dot(b, c)) == -1) return +2;
    if(norm(b) < norm(c)) return -2;
    return 0;
}
Real closest_pair(vector<Point> ps) {
    if((int)ps.size() <= 1) return Real(1e18);
    sort(ps.begin(), ps.end(), comp_x);
    vector<Point> memo(ps.size());
    auto func = [&](auto& func, int l, int r) -> Real {
        if(r - l <= 1) return Real(1e18);
        int m = (l + r) >> 1;
        Real x = ps[m].real();
        Real res = min(func(func, l, m), func(func, m, r));
        inplace_merge(ps.begin() + l, ps.begin() + m, ps.begin() + r, comp_y);
        int cnt = 0;
        for(int i = l; i < r; ++i) {
            if(abs(ps[i].real() - x) >= res) continue;
            for(int j = 0; j < cnt; ++j) {
                Point d = ps[i] - memo[cnt - j - 1];
                if(d.imag() >= res) break;
                res = min(res, abs(d));
            }
            memo[cnt++] = ps[i];
        }
        return res;
    };
    return func(func, 0, (int)ps.size());
}
struct Line {
    Point a, b;
    Line() = default;
    Line(const Point& a, const Point& b)
        : a(a), b(b) {}
};
using Segment = Line;
bool is_parallel(const Line& a, const Line& b) {
    return eq(cross(a.b - a.a, b.b - b.a), 0.0);
}
bool is_orthogonal(const Line& a, const Line& b) {
    return eq(dot(a.b - a.a, b.b - b.a), 0.0);
}
Point projection(const Line& l, const Point& p) {
    Real t = dot(p - l.a, l.b - l.a) / norm(l.b - l.a);
    return l.a + (l.b - l.a) * t;
}
Point reflection(const Line& l, const Point& p) {
    return p + (projection(l, p) - p) * 2.0;
}
bool is_intersect_lp(const Line& l, const Point& p) {
    return abs(ccw(l.a, l.b, p)) != 1;
}
bool is_intersect_sp(const Segment& s, const Point& p) {
    return ccw(s.a, s.b, p) == 0;
}
bool is_intersect_ll(const Line& l1, const Line& l2) {
    if(!eq(cross(l1.b - l1.a, l2.b - l2.a), 0.0)) return true;
    return eq(cross(l1.b - l1.a, l2.b - l1.a), 0.0);
}
bool is_intersect_ls(const Line& l, const Segment& s) {
    return sign(cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a)) <= 0;
}
bool is_intersect_sl(const Segment& s, const Line& l) {
    return is_intersect_ls(l, s);
}
bool is_intersect_ss(const Segment& s1, const Segment& s2) {
    if(ccw(s1.a, s1.b, s2.a) * ccw(s1.a, s1.b, s2.b) > 0) return false;
    return ccw(s2.a, s2.b, s1.a) * ccw(s2.a, s2.b, s1.b) <= 0;
}
vector<Point> intersection_ll(const Line& l1, const Line& l2) {
    vector<Point> res;
    if(!is_intersect_ll(l1, l2)) return res;
    Real a = cross(l1.b - l1.a, l2.b - l2.a);
    Real b = cross(l1.b - l1.a, l1.b - l2.a);
    if(eq(a, 0.0) and eq(b, 0.0)) {
        res.emplace_back(l2.a);
    } else {
        res.emplace_back(l2.a + (l2.b - l2.a) * b / a);
    }
    return res;
}
vector<Point> intersection_ss(const Segment& s1, const Segment& s2) {
    return is_intersect_ss(s1, s2) ? intersection_ll(Line(s1), Line(s2)) : vector<Point>();
}
Real dist_lp(const Line& l, const Point& p) {
    return abs(p - projection(l, p));
}
Real dist_sp(const Segment& s, const Point& p) {
    const Point h = projection(s, p);
    if(is_intersect_sp(s, h)) return abs(h - p);
    return min(abs(s.a - p), abs(s.b - p));
}
Real dist_ll(const Line& l1, const Line& l2) {
    if(is_intersect_ll(l1, l2)) return 0.0;
    return dist_lp(l1, l2.a);
}
Real dist_ss(const Segment& s1, const Segment& s2) {
    if(is_intersect_ss(s1, s2)) return 0.0;
    return min({dist_sp(s1, s2.a), dist_sp(s1, s2.b), dist_sp(s2, s1.a), dist_sp(s2, s1.b)});
}
Real dist_ls(const Line& l, const Segment& s) {
    if(is_intersect_ls(l, s)) return 0.0;
    return min(dist_lp(l, s.a), dist_lp(l, s.b));
}
Real dist_sl(const Segment& s, const Line& l) {
    return dist_ls(l, s);
}
Real area(const vector<Point>& polygon) {
    Real res = 0.0;
    const int n = (int)polygon.size();
    for(int i = 0; i < n; ++i) {
        res += cross(polygon[i], polygon[(i + 1) % n]);
    }
    return abs(res * 0.5);
}
bool is_convex(const vector<Point>& polygon) {
    const int n = (int)polygon.size();
    for(int i = 0; i < n; ++i) {
        if(ccw(polygon[(i - 1 + n) % n], polygon[i], polygon[(i + 1) % n]) == -1) return false;
    }
    return true;
}
int in_polygon(const vector<Point>& polygon, const Point& p) {
    const int n = (int)polygon.size();
    int ret = 0;
    for(int i = 0; i < n; ++i) {
        Point a = polygon[i] - p, b = polygon[(i + 1) % n] - p;
        if(eq(cross(a, b), 0.0) and sign(dot(a, b)) <= 0) return 1;
        if(a.imag() > b.imag()) swap(a, b);
        if(sign(a.imag()) <= 0 and sign(b.imag()) == 1 and sign(cross(a, b)) == 1) ret ^= 2;
    }
    return ret;
}
vector<Point> convex_hull(vector<Point> ps) {
    sort(ps.begin(), ps.end(), comp_x);
    ps.erase(unique(ps.begin(), ps.end()), ps.end());
    int n = (int)ps.size(), k = 0;
    if(n == 1) return ps;
    vector<Point> ch(2 * n);
    for(int i = 0; i < n; ch[k++] = ps[i++]) {
        while(k >= 2 and sign(cross(ch[k - 1] - ch[k - 2], ps[i] - ch[k - 1])) == -1) {
            --k;
        }
    }
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]) {
        while(k >= t and sign(cross(ch[k - 1] - ch[k - 2], ps[i] - ch[k - 1])) == -1) {
            --k;
        }
    }
    ch.resize(k - 1);
    return ch;
}
Real convex_diameter(const vector<Point>& polygon) {
    int n = (int)polygon.size(), is = 0, js = 0;
    for(int i = 1; i < n; ++i) {
        if(sign(polygon[i].imag() - polygon[is].imag()) == 1) is = i;
        if(sign(polygon[i].imag() - polygon[js].imag()) == -1) js = i;
    }
    Real maxdis = norm(polygon[is] - polygon[js]);
    int i = is, j = js;
    do {
        if(sign(cross(polygon[(i + 1) % n] - polygon[i], polygon[(j + 1) % n] - polygon[j])) >= 0) {
            j = (j + 1) % n;
        } else {
            i = (i + 1) % n;
        }
        if(norm(polygon[i] - polygon[j]) > maxdis) {
            maxdis = norm(polygon[i] - polygon[j]);
        }
    } while(i != is or j != js);
    return sqrt(maxdis);
}
vector<Point> convex_cut(const vector<Point>& polygon, const Line& l) {
    const int n = (int)polygon.size();
    vector<Point> res;
    for(int i = 0; i < n; ++i) {
        const Point cur = polygon[i], nex = polygon[(i + 1) % n];
        if(ccw(l.a, l.b, cur) != -1) res.emplace_back(cur);
        if(ccw(l.a, l.b, cur) * ccw(l.a, l.b, nex) < 0) {
            res.emplace_back(intersection_ll(Line(cur, nex), l)[0]);
        }
    }
    return res;
}
int main(void) {
    while(1) {
        int n;
        cin >> n;
        if(n == 0) break;
        vector<Point> poly(n);
        rep(i, 0, n) {
            cin >> poly[i];
        }
        vector<Point> ch = convex_hull(poly);
        vector<bool> is_in(n);
        rep(i, 0, n) {
            if(in_polygon(ch, poly[i]) == 2) {
                is_in[i] = true;
            }
        }
        bool ans = true;
        rep(i, 0, n) {
            if(is_in[i]) {
                int i1 = -1, i2 = -1;
                rrep(j, i - 1, -n) {
                    if(!is_in[(j + 2 * n) % n] and !is_in[(j - 1 + 2 * n) % n]) {
                        i1 = (j + 2 * n) % n;
                        i2 = (j - 1 + 2 * n) % n;
                        break;
                    }
                }
                if(i1 == -1 and i2 == -1) {
                    ans = false;
                    break;
                }
                int j1 = -1, j2 = -1;
                rep(j, i + 1, 2 * n) {
                    if(!is_in[j % n] and !is_in[(j + 1) % n]) {
                        j1 = j % n;
                        j2 = (j + 1) % n;
                        break;
                    }
                }
                if(j1 == -1 and j2 == -1) {
                    ans = false;
                    break;
                }
                if(i1 == j2) {
                    ans = false;
                    break;
                }
                Line l1 = Line(poly[i1], poly[i2]), l2 = Line(poly[j1], poly[j2]);
                if(is_parallel(l1, l2) and eq(dist_ll(l1, l2), 0.0)) {
                } else {
                    ans = false;
                }
                if(j1 < i) break;
                i = j1;
            }
        }
        if(ans) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    }
}
accuracy: 1
time_ms: 70
memory_kb: 3492
final_rank: 9

code_snippet: #include <bits/stdc++.h>
using namespace std;

using Real = long double;
using Point = complex<Real>;
const Real EPS = 1e-9, PI = acos(-1);

inline bool eq(Real a, Real b)
{
  return abs(b - a) < EPS;
}

using Polygon = vector<Point>;

namespace std {
bool operator< (const Point &a, const Point &b)
{
  return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
}
}

Real cross(const Point &a, const Point &b)
{
  return real(a) * imag(b) - imag(a) * real(b);
}

bool parallel(const Point &a, const Point &b)
{
  return eq(cross(a, b), 0.0);
}

vector<int> convex_hull(const Polygon &p)
{
  int n = (int)p.size(), k = 0;
  assert(n >= 3);
  
  vector< pair<Point, int> > vec;
  for (int i = 0; i < n; ++i) vec.push_back({p[i], i});
  sort(vec.begin(), vec.end());
  
  vector<int> ch(2 * n);
  vector< Point > pp(2 * n);
  for (int i = 0; i < n; pp[k] = vec[i].first, ch[k++] = vec[i++].second)
  {
    while (k >= 2 && cross(pp[k - 1] - pp[k - 2], vec[i].first - pp[k-1]) < EPS) --k;
  }
  for (int i = n - 2, t = k + 1; i >= 0; pp[k] = vec[i].first, ch[k++] = vec[i--].second)
  {
    while (k >= t && cross(pp[k - 1] - pp[k - 2], vec[i].first - pp[k-1]) < EPS) --k;
  }
  ch.resize(k - 1);
  return ch;
}

bool is_end = false;

void solve()
{
  int N; cin >> N;
  if (N == 0)
  {
    is_end = true;
    return;
  }
  
  vector< Point > real_points(N);
  for (int i = 0; i < N; ++i)
  {
    int x, y; cin >> x >> y;
    real_points[i] = Point(x, y);
  }
  
  vector< int > conv_ids = convex_hull(real_points);
  int siz = conv_ids.size();
  bool ans = true;
  for (int i = 0; i < siz; ++i)
  {
    int id0 = conv_ids[i], id1 = conv_ids[(i+1)%siz];
    if ((id1 - id0 + N) % N == 1) continue;
    
    Point dp = real_points[id1] - real_points[id0];
    
    {
      Point diff = real_points[(id0 + 1) % N] - real_points[id0];
      if (!parallel(dp, diff)) ans = false;
      
      diff = real_points[id1] - real_points[(id1 - 1 + N) % N];
      if (!parallel(dp, diff)) ans = false;
    }
  }
  
  cout << (ans ? "Yes" : "No") << endl;
  
  return;
}

int main()
{
  while (!is_end)
  {
    solve();
  }
  
  return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3404
final_rank: 1

code_snippet: /// 生成AI不使用 / Not using generative AI

// #pragma GCC target ("avx")
// #pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#ifdef MARC_LOCAL
#define _GLIBCXX_DEBUG
#endif

#ifdef ATCODER
#include <atcoder/all>
using namespace atcoder;
#endif

#include <bits/stdc++.h>
using namespace std;

//#define int long long
using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vvvvll = vector<vvvll>;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vvvvi = vector<vvvi>;
using ld = long double; using vld = vector<ld>; using vvld = vector<vld>; using vd = vector<double>;
using vc = vector<char>; using vvc = vector<vc>; using vs = vector<string>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using pii = pair<int, int>; using pcc = pair<char, char>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pdd = pair<double, double>; using pldld = pair<ld,ld>;
using vpii = vector<pii>; using vvpii = vector<vpii>; using vpll = vector<pll>; using vvpll = vector<vpll>; using vpldld = vector<pldld>;
using ui = unsigned int; using ull = unsigned long long;
using i128 = __int128; using f128 = __float128;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vec(type, name, ...) vector<type> name(__VA_ARGS__)
#define vv(type, name, h, ...) vector<vector<type> > name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type> > > name(h, vector<vector<type> >(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) vector<vector<vector<vector<type> > > > name(a, vector<vector<vector<type> > >(b, vector<vector<type> >(c, vector<type>(__VA_ARGS__))))

#define overload4(a,b,c,d,name,...) name
#define rep1(n) for(ll i = 0; i < (ll)n; i++)
#define rep2(i,n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i,a,b) for (ll i = a; i < (ll)b; i++)
#define rep4(i,a,b,c) for (ll i = a; i < (ll)b; i += (ll)c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define repback1(n) for (ll i = (ll)n-1; i >= 0; i--)
#define repback2(i,n) for (ll i = (ll)n-1; i >= 0; i--)
#define repback3(i,a,b) for (ll i = (ll)b-1; i >= (ll)a; i--)
#define repback4(i,a,b,c) for (ll i = (ll)b-1; i >= (ll)a; i -= (ll)c)
#define repback(...) overload4(__VA_ARGS__,repback4,repback3,repback2,repback1)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define include(y, x, H, W) (0 <= (y) && (y) < (H) && 0 <= (x) && (x) < (W))
#define inrange(x, down, up) ((down) <= (x) && (x) <= (up))
#define pb push_back
#define eb emplace_back
#define fir first
#define sec second
#define TIMER_START TIME_START = clock()
#ifdef MARC_LOCAL
// https://trap.jp/post/1224/
#define debug1(x) cout << "debug: " << (#x) << ": " << (x) << endl
#define debug2(x, y) cout << "debug: " << (#x) << ": " << (x) << ", " << (#y) << ": " << (y) << endl
#define debug3(x, y, z) cout << "debug: " << (#x) << ": " << (x) << ", " << (#y) << ": " << (y) << ", " << (#z) << ": " << (z) << endl
#define debug4(x, y, z, w) cout << "debug: " << (#x) << ": " << (x) << ", " << (#y) << ": " << (y) << ", " << (#z) << ": " << (z) << ", " << (#w) << ": " << (w) << endl
#define debug5(x, y, z, w, v) cout << "debug: " << (#x) << ": " << (x) << ", " << (#y) << ": " << (y) << ", " << (#z) << ": " << (z) << ", " << (#w) << ": " << (w) << ", " << (#v) << ": " << (v) << endl
#define debug6(x, y, z, w, v, u) cout << "debug: " << (#x) << ": " << (x) << ", " << (#y) << ": " << (y) << ", " << (#z) << ": " << (z) << ", " << (#w) << ": " << (w) << ", " << (#v) << ": " << (v) << ", " << (#u) << ": " << (u) << endl
#define overload6(a, b, c, d, e, f, g,...) g
#define debug(...) overload6(__VA_ARGS__, debug6, debug5, debug4, debug3, debug2, debug1)(__VA_ARGS__)
#define debuga cerr << "a" << endl
#define debugnl cout << endl
#define Case(i) cout << "Case #" << (i) << ": "
#define TIMECHECK cerr << 1000.0 * static_cast<double>(clock() - TIME_START) / CLOCKS_PER_SEC << "ms" << endl
#define LOCAL 1
#else
#define debug1(x) void(0)
#define debug2(x, y) void(0)
#define debug3(x, y, z) void(0)
#define debug4(x, y, z, w) void(0)
#define debug5(x, y, z, w, v) void(0)
#define debug6(x, y, z, w, v, u) void(0)
#define debug(...) void(0)
#define debuga void(0)
#define debugnl void(0)
#define Case(i) void(0)
#define TIMECHECK void(0)
#define LOCAL 0
#endif

//mt19937_64 rng(0);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
clock_t TIME_START;
const long double pi = 3.141592653589793238462643383279L;
const long long INFL = 1000000000000000000ll;
const long long INFLMAX = numeric_limits< long long >::max(); // 9223372036854775807
const int INF = 1000000000;
const int INFMAX = numeric_limits< int >::max(); // 2147483647
const long double INFD = numeric_limits<ld>::infinity();
const long double EPS = 1e-10;
const int mod1 = 1000000007;
const int mod2 = 998244353;
const vi dx1 = {1,0,-1,0};
const vi dy1 = {0,1,0,-1};
const vi dx2 = {0, 1, 1, 1, 0, -1, -1, -1};
const vi dy2 = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr char nl = '\n';
constexpr char bl = ' ';

std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) {__uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do {--d;*d = "0123456789"[tmp % 10];tmp /= 10;} while (tmp != 0);if (value < 0) {--d;*d = '-';}int len = std::end(buffer) - d;if (dest.rdbuf()->sputn(d, len) != len) {dest.setstate(std::ios_base::badbit);}}return dest; }
__int128 parse(string &s) { __int128 ret = 0; for (int i = 0; i < (int)s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } // for __int128 (https://kenkoooo.hatenablog.com/entry/2016/11/30/163533)
template<class T> ostream& operator << (ostream& os, vector<T>& vec) { os << "["; for (int i = 0; i<(int)vec.size(); i++) { os << vec[i] << (i + 1 == (int)vec.size() ? "" : ", "); } os << "]"; return os; } /// vector 出力
template<class T, class U> ostream& operator << (ostream& os, pair<T, U>& pair_var) { os << "(" << pair_var.first << ", " << pair_var.second << ")"; return os; } // pair 出力
template<class T, class U> ostream& operator << (ostream& os, map<T, U>& map_var) { os << "{"; for (auto itr = map_var.begin(); itr != map_var.end(); itr++) { os << "(" << itr->first << ", " << itr->second << ")"; itr++; if(itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } // map出力
template<class T> ostream& operator << (ostream& os, set<T>& set_var) { os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) { os << *itr; ++itr; if(itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } /// set 出力

bool equals(long double a, long double b) { return fabsl(a - b) < EPS; }
template<class T> int sign(T a) { return equals(a, 0) ? 0 : a > 0 ? 1 : -1; }
long double radian_to_degree(long double r) { return (r * 180.0 / pi); }
long double degree_to_radian(long double d) { return (d * pi / 180.0); }

int popcnt(unsigned long long a){ return __builtin_popcountll(a); } // ll は 64bit対応！
int MSB1(unsigned long long x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } // MSB(1), 0-indexed ( (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2) )
int LSB1(unsigned long long x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } // LSB(1), 0-indexed ( (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2) )
long long maskbit(int n) { return (1LL << n) - 1; }
bool bit_is1(long long x, int i) { return ((x>>i) & 1); }
string charrep(int n, char c) { return std::string(n, c); }
template<class T> T square(T x) { return (x) * (x); }
template<class T>void UNIQUE(T& A) {sort(all(A)); A.erase(unique(all(A)), A.end());}
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T, class U> bool chmin(T& a, const U& b){ return chmin(a, (T)b); }
template<class T, class U> bool chmax(T& a, const U& b){ return chmax(a, (T)b); }
void YESNO(bool b) {if(b){cout<<"YES"<<'\n';} else{cout<<"NO"<<'\n';}} void YES() {YESNO(true);} void NO() {YESNO(false);}
void yesno(bool b) {if(b){cout<<"yes"<<'\n';} else{cout<<"no"<<'\n';}} void yes() {yesno(true);} void no() {yesno(false);}
void YesNo(bool b) {if(b){cout<<"Yes"<<'\n';} else{cout<<"No"<<'\n';}} void Yes() {YesNo(true);} void No() {YesNo(false);}
void POSIMPOS(bool b) {if(b){cout<<"POSSIBLE"<<'\n';} else{cout<<"IMPOSSIBLE"<<'\n';}}
void PosImpos(bool b) {if(b){cout<<"Possible"<<'\n';} else{cout<<"Impossible"<<'\n';}}
void posimpos(bool b) {if(b){cout<<"possible"<<'\n';} else{cout<<"impossible"<<'\n';}}
void FIRSEC(bool b) {if(b){cout<<"FIRST"<<'\n';} else{cout<<"SECOND"<<'\n';}}
void firsec(bool b) {if(b){cout<<"first"<<'\n';} else{cout<<"second"<<'\n';}}
void FirSec(bool b) {if(b){cout<<"First"<<'\n';} else{cout<<"Second"<<'\n';}}
void AliBob(bool b) {if(b){cout<<"Alice"<<'\n';} else{cout<<"Bob"<<'\n';}}
void TakAok(bool b) {if(b){cout<<"Takahashi"<<'\n';} else{cout<<"Aoki"<<'\n';}}
int GetTime() {return 1000.0*static_cast<double>(clock() - TIME_START) / CLOCKS_PER_SEC;}
ll myRand(ll B) {return (unsigned long long)rng() % B;}
template<class T> void print(const T& x, const char endch = '\n') { cout << x << endch; }

template<class T> T ceil_div(T x, T y) { assert(y); return (x > 0 ? (x + y - 1) / y : x / y); }
template<class T> T floor_div(T x, T y) { assert(y); return (x > 0 ? x / y : (x - y + 1) / y); }
template<class T> pair<T, T> divmod(T x, T y) { T q = floor_div(x, y); return {q, x - q * y}; } /// (q, r) s.t. x = q*y + r 
ll GCD(ll a, ll b) { if(a < b) swap(a, b); if(b == 0) return a; if(a%b == 0) return b; else return GCD(b, a%b); }
ll LCM(ll a, ll b) { assert(GCD(a,b) != 0); return a / GCD(a, b) * b; }
ll MOD(ll &x, const ll P) { ll ret = x%P; if(ret < 0) ret += P; return x = ret; } /// x % P を非負整数に直す
ll mpow(ll x, ll n, const ll mod) { x %= mod; ll ret = 1; while(n > 0) { if(n & 1) ret = ret * x % mod; x = x * x % mod; n >>= 1; } return ret; } /// x^n % mod を計算
ll lpow(ll x, ll n) { ll ret = 1; while(n > 0){ if(n & 1) ret = ret * x; x = x * x; n >>= 1; } return ret; } /// x^nを計算
string toBinary(ll n) { if(n == 0) return "0"; assert(n > 0); string ret; while (n != 0){ ret += ( (n & 1) == 1 ? '1' : '0' ); n >>= 1; } reverse(ret.begin(), ret.end()); return ret; } /// 10進数(long long) -> 2進数(string)への変換
ll toDecimal(string S) { ll ret = 0; for(int i = 0; i < (int)S.size(); i++){ ret *= 2LL; if(S[i] == '1') ret += 1; } return ret; } /// 2進数(string)　→　10進数(long long)への変換
int ceil_pow2(ll n) { int x = 0; while ((1ll << x) < n) x++; return x;} /// return minimum non-negative `x` s.t. `n <= 2**x`
int floor_pow2(ll n) { int x = 0; while ((1ll << (x+1)) <= n) x++; return x;} /// return maximum non-negative `x` s.t. `n >= 2**x`


// ############################
// #                          #
// #    C O D E  S T A R T    #
// #                          #
// ############################

/// 2D計算幾何ライブラリ
// 謎のバグが発生したら、比較部分での誤差（±EPSを設定）や整数幾何で出来ないか？を考えると良いかも
// AOJの文字数制限に引っかかる場合は、仕方ないので適当に不要な関数を削る
namespace Geometry {
    constexpr long double EPS = (1e-10);
    constexpr long double pi = 3.141592653589793238462643383279L;
    std::mt19937_64 mt(std::chrono::steady_clock::now().time_since_epoch().count());

    template <class T, class U> bool equals(T a, U b) { return fabsl(a - b) < EPS; }
    template <class T, class U> bool notequals(T a, U b) { return !equals(a, b); }
    template <class T> int sign(T a) { return equals(a, 0) ? 0 : a > 0 ? 1 : -1; }


    /// 2次元平面上の点(x,y)
    template <class T>
    class Point2D { // D は dimension の D (Double ではない) -> OpenGL等の著名ライブラリとの命名規則統一すべき？
        public:
            T x, y; // privateにしても良い、要検討
            bool valid; // 有効な点か？
            int idx;

            Point2D() : x(0), y(0), valid(false) {}
            Point2D(T x, T y): x(x), y(y), valid(true) {}
            template <class U> Point2D(const Point2D<U>& P_) : x((T)P_.x), y((T)P_.y), valid(P_.valid), idx(P_.idx) {}
            template <class U1, class U2> Point2D(const std::pair<U1, U2>& p) : x(p.first), y(p.second), valid(true) {}
    
            
            Point2D operator + (const Point2D& p) const {return Point2D(x + p.x, y + p.y); }
            Point2D operator - (const Point2D& p) const {return Point2D(x - p.x, y - p.y); }
            Point2D operator * (T a) const {return Point2D(a * x, a * y); }
            Point2D operator / (T a) const {return Point2D(x / a, y / a); }
            Point2D& operator+=(const Point2D& p) { return (*this) = (*this) + p; }
            Point2D& operator-=(const Point2D& p) { return (*this) = (*this) - p; }
            Point2D& operator*=(T a) { return (*this) = (*this) * a; }
            Point2D& operator/=(T a) { return (*this) = (*this) / a; }
            bool operator<(const Point2D& p) const { return notequals(x, p.x) ? x < p.x : y < p.y; }
            bool operator==(const Point2D& p) const { return equals(x, p.x) && equals(y, p.y); }
            bool operator!=(const Point2D& p) const { return !((*this) == p); }
    

            T real() const { return x; }
            T imag() const { return y; }
            T xpos() const { return x; }
            T ypos() const { return y; }
            T dot(const Point2D& p) const { return x * p.x + y * p.y; }
            T cross(const Point2D& p) const { return x * p.y - y * p.x; }
            T norm() const { return x * x + y * y; }
            long double abs() const { return std::sqrt(norm()); }
            long double arg() const { return std::atan2(y, x); }

            // Center中心、反時計回りにrad度回転
            void rotate(const Point2D& Center, const T rad) {
                x -= Center.x, y -= Center.y;
                T x_ = x * std::cos(rad) - y * std::sin(rad);
                T y_ = x * std::sin(rad) + y * std::cos(rad);
                x = x_ + Center.x, y = y_ + Center.y;
            }

            // 原点中心、反時計回りにrad度回転
            void rotate(const T rad) { 
                rotate(Point2D(0, 0), rad);
            }

            // 原点中心、反時計回りに90度回転
            void rot90() {
                T x_ = -y;
                y = x, x = x_;
            }

            // 単位ベクトルになるように変換
            void unit() {
                T len = this->abs();
                x /= len, y /= len;
            }

            // 偏角ソート用
            int argpos() const {
                if (equals(y, 0) && 0 <= x) return 0;
                if (y < 0) return -1;
                return 1;
            }

            void set_index(int i) { idx = i; }
            
            friend std::istream& operator>>(std::istream& is, Point2D& p) {
                T a, b;
                is >> a >> b;
                p = Point2D(a, b);
                return is;
            }
            friend std::ostream& operator<<(std::ostream& os, const Point2D& p) {
                return os << std::fixed << std::setprecision(15) << p.x << " " << p.y;
            }


        private :
            // constexpr long double EPS = (1e-10);
            // constexpr long double pi = 3.141592653589793238462643383279L;
            
            // bool equals(T a, T b) { return fabsl(a - b) < EPS; }
            // bool notequals(T a, T b) { return !equlas(a, b); }
            // int sign(T a) { return equals(a, 0) ? 0 : a > 0 ? 1 : -1; }
    };
    using Point = Point2D<long double>;
    using Points = std::vector<Point>;
    using PoINT = Point2D<long long>;
    using PoINTs = std::vector<PoINT>;
    template <class T> 
    using Polygon = std::vector<Point2D<T> >; // 多角形

    template <class T>
    using Vector2D = Point2D<T>; // 向き(x,y)と大きさ(abs(x,y))を持つ
    using Vector = Vector2D<long double>;


    template <class T> T real(const Point2D<T>& p) { return p.x; } // 実部
    template <class T> T imag(const Point2D<T>& p) { return p.y; } // 虚部
    template <class T> T dot(const Point2D<T>& l, const Point2D<T>& r) { return l.x * r.x + l.y * r.y; } // 内積
    template <class T> T cross(const Point2D<T>& l, const Point2D<T>& r) { return l.x * r.y - l.y * r.x; } // 外積
    template <class T> T norm(const Point2D<T>& p) { return p.x * p.x + p.y * p.y; } // 2-ノルム（ユークリッドノルム）の2乗
    template <class T> long double abs(const Point2D<T>& p) { return std::sqrt(norm(p)); } // 大きさ（絶対値）
    template <class T> long double arg(const Point2D<T>& p) { return std::atan2(p.y, p.x); } // 偏角
    Point polar_to_xy(const long double r, const long double theta) { return Point(r * std::cos(theta), r * std::sin(theta)); } // 極座標(r, theta) -> xy座標(x, y)

    template <class T>
    long double arg(const Point2D<T>& P1, const Point2D<T>& P2) {
        return std::atan2(cross(P1, P2), dot(P1, P2));
    }

    // 偏角ソート(-pi ~ pi)
    template<class T>
    void arg_sort(std::vector<Point2D<T> >& Ps) {
        std::sort(Ps.begin(), Ps.end(), [](const Point2D<T>& P1, const Point2D<T>& P2) {
            if(P1.argpos() != P2.argpos()) return P1.argpos() < P2.argpos();
            return cross(P1, P2) > 0;
        });
    }

    // x座標でソート
    template<class T>
    void x_sort(std::vector<Point2D<T> >& Ps) {
        std::sort(Ps.begin(), Ps.end(), [](const Point2D<T>& a, const Point2D<T>& b){ return equals(a.x, b.x) ? a.y < b.y : a.x < b.x; });
    }

    // y座標でソート
    template<class T>
    void y_sort(std::vector<Point2D<T> >& Ps) {
        std::sort(Ps.begin(), Ps.end(), [](const Point2D<T>& a, const Point2D<T>& b){ return equals(a.y, b.y) ? a.x < b.x : a.y < b.y; });
    }


    /// Pを、Center中心、反時計回りにrad度回転
    template <class T>
    Point2D<T> rotate(Point2D<T> P, const Point2D<T>& Center, const T rad) {
        P -= Center;
        T x_ = P.x * std::cos(rad) - P.y * std::sin(rad);
        T y_ = P.x * std::sin(rad) + P.y * std::cos(rad);
        return Point2D<T>(x_ + Center.x, y_ + Center.y);
    }

    /// 点Pを、原点中心、反時計回りにrad度回転
    template <class T>
    Point2D<T> rotate(const Point2D<T>& P, const T rad) { 
        return rotate(P, Point2D<T>(0, 0), rad);
    }

    // 原点中心、反時計回りに90度回転
    template <class T>
    Point2D<T> rot90(const Point2D<T>& P) {
        return Point2D<T>(-P.y, P.x);
    }

    /// V1の単位ベクトルを取得
    template <class T>
    Vector2D<T> unit(const Vector2D<T>& V1) {
        return V1 / V1.abs();
    }
    template <class T>
    Vector2D<T> unit(const Point2D<T>& P1, const Point2D<T>& P2) {
        Vector2D<T> V = P2 - P1;
        return unit(V);
    }

    /// 二点間の中点を取得
    template <class T>
    Point2D<T> mid(const Point2D<T>& P1, const Point2D<T>& P2) {
        return Point2D<T>((P1.x + P2.x) / 2, (P1.y + P2.y) / 2);
    }

    /// ベクトルAとベクトルBのなす角（B->Aの回転角、[-pi,pi]）
    template <class T>
    long double get_angle(const Vector2D<T>& V1, const Vector2D<T>& V2) {
        long double ret = arg(V1) - arg(V2);
        while(ret > pi + EPS) ret -= 2 * pi;
        while(ret < -pi - EPS) ret += 2 * pi;
        return ret;
    }

    /// 2点 P1, P2 を通る二次元平面上の直線 Ax + By + C = 0
    template <class T>
    class Line2D {
        public : 
            Point2D<T> P1, P2;
            T A, B, C;
            int idx;

            Line2D() = default;

            // P1, P2 -> Ax + By + C = 0 を計算
            Line2D(Point2D<T> P1, Point2D<T> P2) : P1(P1), P2(P2) // check
            {
                A = P2.y - P1.y;
                B = P1.x - P2.x;
                C = P1.y * (P2.x - P1.x) - P1.x * (P2.y - P1.y);
            }
            Line2D(T x1, T y1, T x2, T y2) : P1(Point2D<T>(x1, y1)), P2(Point2D<T>(x2, y2)) // check
            {
                A = P2.y - P1.y;
                B = P1.x - P2.x;
                C = P1.y * (P2.x - P1.x) - P1.x * (P2.y - P1.y);
            }

            // Ax + By + C = 0 -> P1, P2 を計算
            Line2D(T A, T B, T C) : A(A), B(B), C(C) // check
            {
                if(equals(A, 0)) P1 = Point2D(0, - C / B), P2 = Point2D(1, - C / B);
                else if(equals(B, 0)) P1 = Point2D(- C / A, 0), P2 = Point2D(- C / A, 1);
                else P1 = Point2D(0, - C / B), P2 = Point2D(- C / A , 0);
            }

            template <class U>
            Line2D(const Line2D<U>& L_) : Line2D<T>(Point2D<T>(L_.P1), Point2D<T>(L_.P2)) {}

            friend std::ostream &operator<<(std::ostream &os, Line2D &L) {
                return os << "(" << L.P1 << "), (" << L.P2 << ") / " << L.A << "x + " << L.B << "y + "<< L.C;
            }


            // 直線の傾きを取得
            T Grad() {
                if(equals(B, 0)) return std::numeric_limits< T >::max();
                return - A / B;
            }

            // 中点を取得
            Point2D<T> mid() {
                return Point2D<T>((P1.x + P2.x) / 2, (P1.y + P2.y) / 2);
            }

            // 垂直二等分線を取得
            Line2D<T> bisector() {
                Point2D<T> M = this->mid();
                return Line2D<T>(M, M + rot90(P2-P1));
            }

            void set_index(int i) { idx = i; }
        

        private:
            // constexpr long double EPS = (1e-10);
            // constexpr long double pi = 3.141592653589793238462643383279L;
            
            // bool equals(T a, T b) { return fabsl(a - b) < EPS; }
            // bool notequals(T a, T b) { return !equlas(a, b); }
            // int sign(T a) { return equals(a, 0) ? 0 : a > 0 ? 1 : -1; }

    };
    using Line = Line2D<long double>;
    using Lines = std::vector<Line>;

    template <class T>
    using Segment2D = Line2D<T>; // P1, P2を端点とする線分
    using Segment = Segment2D<long double>;
    using Segments = std::vector<Segment>;

    /// 直線Aと直線Bのなす角（is_abs : 絶対値取る？, under90 : 0~pi/2に正規化？）
    template <class T>
    long double get_angle(const Line2D<T>& L1, const Line2D<T>& L2, const bool is_abs = false, const bool under90 = false) {
        long double ret = get_angle(L1.P2 - L1.P1, L2.P2 - L2.P1);
        if(is_abs) ret = std::abs(ret);
        if(under90 && ret > pi/2 + EPS) ret = pi - ret;
        if(under90 && ret < -pi/2 - EPS) ret = -pi - ret;
        return ret;
    }

    /// 二点間の垂直二等分線を取得
    template <class T>
    Line2D<T> bisector(const Point2D<T>& P1, const Point2D<T>& P2) {
        Point2D<T> M = mid(P1, P2);
        return Line2D<T>(M, M + rot90(P2-P1));
    }

    /// 中心点 c と、半径 r を持つ二次元平面上の円
    // TODO: 整数用に、半径を2乗で管理？2乗用の変数を追加しても良い 
    template <class T>
    class Circle {
        public:
            Point2D<T> center;
            T radius;

            Circle() = default;

            Circle(T x, T y, T radius) : center(Point2D<T>(x, y)), radius(radius) {}

            Circle(Point2D<T> center, T radius) : center(center), radius(radius) {}

            template<class U>
            Circle(Circle<U> C_) : center(Point2D<T>(C_.center)), radius((T)C_.radius) {}

            bool operator==(const Circle& C) const { return center == C.center && equals(radius, C.radius); }
            bool operator!=(const Circle& C) const { return !((*this) == C); }

    
    };
    template <class T>
    using Circles = std::vector<Circle<T> >;
    using Circld = Circle<long double>;
    using Circlds = std::vector<Circld >;

    static const int COUNTER_CLOCKWISE = 1; // 反時計回り
    static const int CLOCKWISE = -1; // 時計回り
    static const int ONLINE_BACK = 2; // P2 -> P0 -> P1 の順で一直線 (P0 -> P1 とは逆方向にP2が存在)
    static const int ONLINE_FRONT = -2; // P0 -> P1 -> P2 の順で一直線 (P0 -> P1 と同方向にP2が存在)
    static const int ON_SEGMENT = 0; // P0 -> P2 -> P1 の順で一直線 (P0 -> P1 内にP2が存在)

    /**
     * @brief p0, p1, p2 がこの順で反時計回り（Counter Clock Wise）か？の判定
     * 
     * @return 1 : COUNTER_CLOCKWISE（反時計回り）
     *         -1 : CLOCKWISE（時計回り）
     *         2 : ONLINE_BACK（P2 -> P0 -> P1 の順で一直線 (P0 -> P1 とは逆方向にP2が存在)）
     *         -2 : ONLINE_FRONT（P0 -> P1 -> P2 の順で一直線 (P0 -> P1 と同方向にP2が存在)）
     *         0 : ON_SEGMENT（P0 -> P2 -> P1 の順で一直線 (P0 -> P1 内にP2が存在)）
     */
    template <class T>
    int ccw(const Point2D<T>& P0, const Point2D<T>& P1, const Point2D<T>& P2) {
        Vector2D<T> V1 = P1 - P0;
        Vector2D<T> V2 = P2 - P0;

        if(cross(V1, V2) > EPS) return COUNTER_CLOCKWISE; // 反時計回り
        else if(cross(V1, V2) < -EPS) return CLOCKWISE; // 時計回り
        else if(dot(V1, V2) < -EPS) return ONLINE_BACK; // P2 -> P0 -> P1 の順で一直線 (P0 -> P1 とは逆方向にP2が存在)
        else if(V1.norm() < V2.norm()) return ONLINE_FRONT; // P0 -> P1 -> P2 の順で一直線 (P0 -> P1 と同方向にP2が存在)
        else return ON_SEGMENT; // P0 -> P2 -> P1 の順で一直線 (P0 -> P1 内にP2が存在)
    }


    /// 直交判定
    template<class T>
    bool isOrthogonal(const Vector2D<T>& a, const Vector2D<T>& b) {
        return equals(dot(a, b), 0.0);
    }
    template<class T>
    bool isOrthogonal(const Point2D<T>& a1, const Point2D<T>& a2, const Point2D<T>& b1, const Point2D<T>& b2) {
        return isOrthogonal(a1 - a2, b1 - b2);
    }
    template<class T>
    bool isOrthogonal(const Line2D<T>& l1, const Line2D<T>& l2) {
        return equals(dot(l1.P2 - l1.P1, l2.P2 - l2.P1), 0.0);
    }


    /// 平行判定
    template<class T>
    bool isParallel(const Vector2D<T>& a, const Vector2D<T>& b) {
        return equals(cross(a, b), 0.0);
    }
    template<class T>
    bool isParallel(const Point2D<T>& a1, const Point2D<T>& a2, const Point2D<T>& b1, const Point2D<T>& b2) {
        return isParallel(a1 - a2, b1 - b2);
    }
    template<class T>
    bool isParallel(const Line2D<T>& l1, const Line2D<T>& l2) {
        return equals(cross(l1.P2 - l1.P1, l2.P2 - l2.P1), 0.0);
    }


    /// 射影
    // 直線l に対して 点p から垂線をおろした交点を求める
    // 内積とcosの関係を用いて計算
    template<class T>
    Point2D<T> projection(const Line2D<T>& l, const Point2D<T>& p) {
        Vector2D<T> base = l.P2 - l.P1;
        long double t = dot(p - l.P1, base) / norm(base);
        return l.P1 + base * t;
    }


    /// 反射
    // 直線l を対称軸として、点p と線対称にある点を求める
    template<class T>
    Point2D<T> reflection(const Line2D<T>& l, const Point2D<T>& p) {
        return p + (projection(l, p) - p) * 2.0;
    }


    /// 凸包（反時計回り）を生成
    // Andrew's Algorithm (x must be sorted)
    // boundary : 周上の点も列挙する場合 true    
    template<class T>
    std::vector<Point2D<T> > ConvexHull(std::vector<Point2D<T> > ps, bool boundary = false) {
        x_sort(ps);
        ps.erase(std::unique(ps.begin(), ps.end()), ps.end());        
        int N = (int)ps.size();
        if (N <= 2) return ps;

        std::vector<Point2D<T> > convex(2*N);
        int k = 0;
        long double th = boundary ? -EPS : +EPS;
        for (int i = 0; i < N; convex[k++] = ps[i++]) {
            while (k >= 2 && cross(convex[k - 1] - convex[k - 2], ps[i] - convex[k - 1]) < th) --k;
        }
        for (int i = N - 2, t = k + 1; i >= 0; convex[k++] = ps[i--]) {
            while (k >= t && cross(convex[k - 1] - convex[k - 2], ps[i] - convex[k - 1]) < th) --k;
        }
        convex.resize(k - 1);
        return convex;
    }
}


void solve() {
    while(true) {
        int N; cin >> N;
        if(N == 0) break;

        Geometry::Polygon<ld> G(N);
        rep(i,N) {
            ld x,y; cin >> x >> y;
            G[i] = Geometry::Point(x,y);
            G[i].set_index(i);
        }
        auto memo = G;

        auto convex = Geometry::ConvexHull(G, true);
        int M = convex.size();
        debug(convex);
        bool ans = true;
        rep(i,M) {
            auto cur = convex[i];
            int idx = cur.idx;
            
            auto gprev = G[(N-1+idx)%N];
            auto gnxt = G[(idx+1)%N];
            //if(gnxt < gprev) swap(gprev, gnxt);

            auto prev = convex[(M-1+i)%M];
            auto nxt = convex[(i+1)%M];
            //if(nxt < prev) swap(prev, nxt);

            if(nxt == gnxt && prev == gprev) continue;
            if(nxt == gprev && prev == gnxt) continue;

            debug(cur,gprev,gnxt,prev,nxt);
            if(prev == gnxt) swap(prev, gnxt);
            if(nxt == gprev) swap(nxt, gprev);

            if(prev == gprev) {
                Geometry::Line L1(gprev, cur);
                Geometry::Line L2(cur, nxt);

                if(!Geometry::isParallel(L1, L2)) {
                    ans = false;
                }
            }
            else {
                Geometry::Line L1(gnxt, cur);
                Geometry::Line L2(cur, prev);

                if(!Geometry::isParallel(L1, L2)) {
                    ans = false;
                }                
            }
        }

        YesNo(ans);
        
    }



}



signed main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    TIMER_START;
    //cout << fixed << setprecision(15);
    

    int tt = 1;
    //cin >> tt;
    //cin.ignore();
    while(tt--){
        solve();
    }

    TIMECHECK;
    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3568
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
template <class T, class U>
inline bool chmax(T& a, U b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T, class U>
inline bool chmin(T& a, U b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
constexpr int INF = 1000000000;
constexpr int64_t llINF = 3000000000000000000;
constexpr double eps = 1e-10;
const double pi = acos(-1);
struct linear_sieve {
    vector<int> least_factor, prime_list;
    linear_sieve(int n) : least_factor(n + 1, 0) {
        for (int i = 2; i <= n; i++) {
            if (least_factor[i] == 0) {
                least_factor[i] = i;
                prime_list.push_back(i);
            }
            for (int p : prime_list) {
                if (ll(i) * p > n || p > least_factor[i]) break;
                least_factor[i * p] = p;
            }
        }
    }
};
ll extgcd(ll a, ll b, ll& x, ll& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}
ll modpow(ll a, ll b, ll m) {
    ll res = 1;
    while (b) {
        if (b & 1) {
            res *= a;
            res %= m;
        }
        a *= a;
        a %= m;
        b >>= 1;
    }
    return res;
}
template <int modulo>
struct modint {
    int x;
    modint() : x(0) {}
    modint(int64_t y) : x(y >= 0 ? y % modulo : (modulo - (-y) % modulo) % modulo) {}
    modint& operator+=(const modint& p) {
        if ((x += p.x) >= modulo) x -= modulo;
        return *this;
    }
    modint& operator-=(const modint& p) {
        if ((x += modulo - p.x) >= modulo) x -= modulo;
        return *this;
    }
    modint& operator*=(const modint& p) {
        x = (int)(1LL * x * p.x % modulo);
        return *this;
    }
    modint& operator/=(const modint& p) {
        *this *= p.inv();
        return *this;
    }
    modint operator-() const { return modint(-x); }
    modint operator+(const modint& p) const { return modint(*this) += p; }
    modint operator-(const modint& p) const { return modint(*this) -= p; }
    modint operator*(const modint& p) const { return modint(*this) *= p; }
    modint operator/(const modint& p) const { return modint(*this) /= p; }
    bool operator==(const modint& p) const { return x == p.x; }
    bool operator!=(const modint& p) const { return x != p.x; }
    modint inv() const {
        int a = x, b = modulo, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return modint(u);
    }
    modint pow(int64_t n) const {
        modint ret(1), mul(x);
        while (n > 0) {
            if (n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }
    friend ostream& operator<<(ostream& os, const modint& p) { return os << p.x; }
    friend istream& operator>>(istream& is, modint& a) {
        int64_t t;
        is >> t;
        a = modint<modulo>(t);
        return (is);
    }
    int val() const { return x; }
    static constexpr int mod() { return modulo; }
    static constexpr int half() { return (modulo + 1) >> 1; }
};
template <typename T>
struct Binomial {
    vector<T> inv, fact, factinv;
    Binomial(int n) {
        inv.resize(n + 1);
        fact.resize(n + 1);
        factinv.resize(n + 1);
        inv[0] = fact[0] = factinv[0] = 1;
        for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * i;
        factinv[n] = fact[n].inv();
        inv[n] = fact[n - 1] * factinv[n];
        for (int i = n - 1; i >= 1; i--) {
            factinv[i] = factinv[i + 1] * (i + 1);
            inv[i] = fact[i - 1] * factinv[i];
        }
    }
    T C(int n, int r) {
        if (n < 0 || n < r || r < 0) return 0;
        return fact[n] * factinv[n - r] * factinv[r];
    }
    T P(int n, int r) {
        if (n < 0 || n < r || r < 0) return 0;
        return fact[n] * factinv[n - r];
    }
    T H(int n, int r) {
        if (n == 0 && r == 0) return 1;
        if (n < 0 || r < 0) return 0;
        return r == 0 ? 1 : C(n + r - 1, r);
    }
};
namespace geometry {

using floating_point_type = long double;

constexpr floating_point_type EPS = 1e-13;
constexpr floating_point_type Pi = 3.141592653589793;

constexpr floating_point_type operator"" _deg(floating_point_type deg) { return static_cast<floating_point_type>(deg * Pi / 180.0); }
constexpr floating_point_type operator"" _deg(unsigned long long deg) { return static_cast<floating_point_type>(deg * Pi / 180.0); }

template <typename T>
constexpr int sgn(T a) noexcept {
    return (a < -EPS ? -1 : (a > EPS ? +1 : 0));
}

template <typename T, typename U>
constexpr bool same(T a, U b) noexcept {
    return sgn(a - b) == 0;
}

template <typename T>
constexpr T square(T x) noexcept {
    return x * x;
}

// ax + by + c = 0, gcd(a,b,c) = 1
// a != 0 : a > 0
// a = 0: b > 0
tuple<long long, long long, long long> general_form(long long x1, long long y1, long long x2, long long y2) {
    long long a = y1 - y2, b = x2 - x1, c = x1 * y2 - x2 * y1;
    if (a < 0) a = -a, b = -b, c = -c;
    if (a == 0 && b < 0) b = -b, c = -c;
    long long g = gcd(gcd(a, b), c);
    return {a / g, b / g, c / g};
}

template <typename T>
struct Vector2D {
    using value_type = T;
    T x, y;

    Vector2D() = default;
    explicit Vector2D(T arg) : x(cos(arg)), y(sin(arg)) {}
    constexpr Vector2D(T x, T y) noexcept : x(x), y(y) {}

    constexpr bool operator<(const Vector2D& v) const noexcept {
        if (!same(x, v.x)) return x < v.x;
        return y < v.y;
    }
    constexpr bool operator>(const Vector2D& v) const noexcept { return v < *this; }
    constexpr bool operator==(const Vector2D& v) const noexcept { return same(x, v.x) && same(y, v.y); }
    constexpr bool operator!=(const Vector2D& v) const noexcept { return !(*this == v); }

    constexpr Vector2D operator+() const noexcept { return *this; }
    constexpr Vector2D operator-() const noexcept { return {-x, -y}; }

    constexpr Vector2D operator+(const Vector2D& v) const noexcept { return {x + v.x, y + v.y}; }
    constexpr Vector2D operator-(const Vector2D& v) const noexcept { return {x - v.x, y - v.y}; }
    constexpr Vector2D operator*(T s) const noexcept { return {x * s, y * s}; }
    constexpr Vector2D operator/(T s) const noexcept { return {x / s, y / s}; }

    constexpr Vector2D& operator+=(const Vector2D& v) noexcept {
        x += v.x;
        y += v.y;
        return *this;
    }
    constexpr Vector2D& operator-=(const Vector2D& v) noexcept {
        x -= v.x;
        y -= v.y;
        return *this;
    }
    constexpr Vector2D& operator*=(T s) noexcept {
        x *= s;
        y *= s;
        return *this;
    }
    constexpr Vector2D& operator/=(T s) noexcept {
        x /= s;
        y /= s;
        return *this;
    }

    constexpr bool isZero() const noexcept { return x == T(0) && y == T(0); }
    bool hasNan() const { return isnan(x) || isnan(y); }

    constexpr T dot(const Vector2D& v) const noexcept { return x * v.x + y * v.y; }
    constexpr T cross(const Vector2D& v) const noexcept { return x * v.y - y * v.x; }

    floating_point_type length() const {
        if (isZero()) return 0.0;

        const T abs_x = std::abs(x);
        const T abs_y = std::abs(y);

        const auto [u, v] = std::minmax(abs_x, abs_y);
        const T t = u / v;

        return v * std::sqrt(std::fma(t, t, 1.0));
    }
    constexpr T lengthSq() const noexcept { return dot(*this); }

    floating_point_type distanceFrom(const Vector2D& v) const { return (v - *this).length(); }
    constexpr T distanceFromSq(const Vector2D& v) const noexcept { return (v - *this).lengthSq(); }

    Vector2D normalized() const { return *this / length(); }
    Vector2D& normalize() { return *this /= length(); }

    Vector2D rotated(floating_point_type angle) const {
        const T s = sin(angle);
        const T c = cos(angle);
        return {x * c - y * s, x * s + y * c};
    }
    Vector2D& rotate(floating_point_type angle) { return *this = rotated(angle); }

    floating_point_type arg() const { return atan2<floating_point_type>(y, x); }
    floating_point_type arg(const Vector2D& v) const {
        if (isZero() || v.isZero()) {
            return numeric_limits<T>::signaling_NaN();
        }

        return atan2<floating_point_type>(cross(v), dot(v));
    }
    floating_point_type arg(const Vector2D& a, const Vector2D& b) const { return (a - *this).arg(b - *this); }

    constexpr Vector2D lerp(const Vector2D& v, T f) const noexcept { return {x + (v.x - x) * f, y + (v.y - y) * f}; }

    constexpr friend Vector2D operator*(T s, const Vector2D& v) noexcept { return {s * v.x, s * v.y}; }
    friend istream& operator>>(istream& is, Vector2D& v) { return is >> v.x >> v.y; }
    friend ostream& operator<<(ostream& os, const Vector2D& v) { return os << "(" << v.x << ", " << v.y << ")"; }
};

template <typename T>
void argument_sort(vector<Vector2D<T>>& vec, const Vector2D<T>& center = Vector2D<T>(0, 0)) {
    auto orthant = [](const Vector2D<T>& v) {
        if (sgn(v.x) < 0 && sgn(v.y) < 0) return 0;
        if (sgn(v.x) >= 0 && sgn(v.y) < 0) return 1;
        if (sgn(v.x) == 0 && sgn(v.y) == 0) return 2;
        if (sgn(v.x) >= 0 && sgn(v.y) >= 0) return 3;
        return 4;
    };

    auto comp = [orthant, center](const Vector2D<T>& a, const Vector2D<T>& b) {
        const int o1 = orthant(a - center), o2 = orthant(b - center);
        if (o1 != o2) return o1 < o2;

        return (a - center).cross(b - center) > 0;
    };

    sort(vec.begin(), vec.end(), comp);
}

template <typename T>
vector<Vector2D<T>> convex_hull(vector<Vector2D<T>> points) {
    int n = points.size(), k = 0;
    vector<Vector2D<T>> res(n * 2);

    sort(points.begin(), points.end());
    points.erase(unique(points.begin(), points.end()), points.end());

    for (int i = 0; i < n; ++i) {
        while (k > 1 && sgn((res[k - 1] - res[k - 2]).cross(points[i] - res[k - 1])) <= 0) k--;
        res[k++] = points[i];
    }

    for (int i = n - 2, t = k; i >= 0; --i) {
        while (k > t && sgn((res[k - 1] - res[k - 2]).cross(points[i] - res[k - 1])) <= 0) k--;
        res[k++] = points[i];
    }

    res.resize(k - 1);
    return res;
}

/*
ABから見てBCは左に曲がるのなら +1
ABから見てBCは右に曲がるのなら -1
BACの順番で一直線上に並ぶなら +2
ABCの順番で一直線上に並ぶなら -2
CがAB上なら 0
*/
template <typename T>
constexpr int ccw(const Vector2D<T>& a, const Vector2D<T>& b, const Vector2D<T>& c) {
    const int res = sgn((b - a).cross(c - a));

    if (res != 0) return res;
    if (sgn((a - b).dot(c - a)) > 0) return +2;
    if (sgn((b - a).dot(c - b)) > 0) return -2;
    return 0;
}

using Vec2 = Vector2D<floating_point_type>;

struct Line {
    using value_type = Vec2::value_type;
    Vec2 begin, end;

    Line() = default;
    constexpr Line(const Vec2& begin, const Vec2& end) : begin(begin), end(end) {}
    constexpr Line(value_type sx, value_type sy, value_type gx, value_type gy) : begin(sx, sy), end(gx, gy) {}

    // ax + by + c = 0
    Line(value_type a, value_type b, value_type c) {
        assert(sgn(a) != 0 || sgn(b) != 0);

        if (sgn(b) == 0) {
            begin = Vec2(-c / a, 0.0);
            end = Vec2(-c / a, 1.0);
        } else {
            begin = Vec2(0, -c / b);
            end = Vec2(1.0, -(a + c) / b);
        }
    }

    constexpr Vec2 vector() const { return end - begin; }

    constexpr Line& reverse() {
        const Vec2 tmp = begin;
        begin = end;
        end = tmp;
        return *this;
    }
    constexpr Line reversed() const { return {end, begin}; }

    constexpr Line& moveBy(const Vec2& v) {
        begin += v;
        end += v;
        return *this;
    }
    constexpr Line movedBy(const Vec2& v) const { return {begin + v, end + v}; }

    constexpr bool isParallel(const Line& line) const { return sgn(vector().cross(line.vector())) == 0; }
    constexpr bool isOrthogonal(const Line& line) const { return sgn(vector().dot(line.vector())) == 0; }

    floating_point_type length() const { return vector().length(); }
    constexpr value_type lengthSq() const { return vector().lengthSq(); }

    floating_point_type distanceFrom(const Vec2& v) const { return fabs(vector().cross(v - begin)) / length(); }
    constexpr value_type distanceFromSq(const Vec2& v) const {
        const value_type d = vector().cross(v - begin);

        return d / lengthSq() * d;
    }

    optional<Vec2> intersectsAt(const Line& line) const {
        if (sgn(vector().cross(line.vector())) == 0) return nullopt;

        return begin + vector() * fabs((line.end - begin).cross(line.vector()) / vector().cross(line.vector()));
    }

    constexpr Vec2 projection(const Vec2& v) const { return begin + vector() * (v - begin).dot(vector()) / lengthSq(); }
    constexpr Vec2 reflection(const Vec2& v) const { return 2 * projection(v) - v; }

    // ax + by + c = 0
    constexpr tuple<value_type, value_type, value_type> generalForm() const {
        const Vec2 vec = vector();
        return {vec.y, -vec.x, end.cross(begin)};
    }

    friend istream& operator>>(istream& is, Line& rhs) { return is >> rhs.begin >> rhs.end; }
};

namespace segment {

using Segment = Line;

constexpr bool intersect(const Segment& a, const Segment& b) {
    return ccw(a.begin, a.end, b.begin) * ccw(a.begin, a.end, b.end) <= 0 && ccw(b.begin, b.end, a.begin) * ccw(b.begin, b.end, a.end) <= 0;
}

floating_point_type distance(const Segment& a, const Vec2& v) {
    if (sgn(a.vector().dot(v - a.begin)) < 0 || sgn((-a.vector()).dot(v - a.end)) < 0) {
        return min(v.distanceFrom(a.begin), v.distanceFrom(a.end));
    }
    return a.distanceFrom(v);
}

constexpr floating_point_type distanceSq(const Segment& a, const Vec2& v) {
    if (sgn(a.vector().dot(v - a.begin)) < 0 || sgn((-a.vector()).dot(v - a.end)) < 0) {
        return min(v.distanceFromSq(a.begin), v.distanceFromSq(a.end));
    }
    return a.distanceFromSq(v);
}

floating_point_type distance(const Segment& a, const Segment& b) {
    if (intersect(a, b)) return 0.0;

    return min({distance(a, b.begin), distance(a, b.end), distance(b, a.begin), distance(b, a.end)});
}
}  // namespace segment

struct Triangle {
    using value_type = Vec2::value_type;
    Vec2 p0, p1, p2;

    Triangle() = default;
    constexpr Triangle(const Vec2& p0, const Vec2& p1, const Vec2& p2) : p0(p0), p1(p1), p2(p2) {}

    constexpr Vec2& p(size_t index) { return (&p0)[index]; }
    constexpr const Vec2& p(size_t index) const { return (&p0)[index]; }

    constexpr Line side(size_t index) const {
        if (index == 0)
            return Line(p1, p2);
        else if (index == 1)
            return Line(p2, p0);
        else if (index == 2)
            return Line(p0, p1);
        else {
            throw std::out_of_range("Triangle::side() index out of range");
        }
    }

    floating_point_type angle(size_t index) const {
        const Vec2 vec[3] = {p(index), p((index + 1) % 3), p((index + 2) % 3)};

        const value_type res = vec[0].arg(vec[1], vec[2]);

        return fabs(res);
    }

    constexpr value_type area() const {
        const value_type res = (p1 - p0).cross(p2 - p0) / 2;
        return (0 < res ? res : -res);
    }

    constexpr Vec2 circumCenter() const {
        const value_type d0 = side(0).lengthSq(), d1 = side(1).lengthSq(), d2 = side(2).lengthSq(), t0 = d0 * (-d0 + d1 + d2),
                         t1 = d1 * (+d0 - d1 + d2), t2 = d2 * (+d0 + d1 - d2), t3 = t0 + t1 + t2;

        return t0 / t3 * p0 + t1 / t3 * p1 + t2 / t3 * p2;
    }

    Vec2 innerCenter() const {
        const value_type dist[3] = {side(0).length(), side(1).length(), side(2).length()};

        return (dist[0] * p0 + dist[1] * p1 + dist[2] * p2) / (dist[0] + dist[1] + dist[2]);
    }

    friend istream& operator>>(istream& is, Triangle& rhs) { return is >> rhs.p0 >> rhs.p1 >> rhs.p2; }
};

struct Circle {
    using value_type = Vec2::value_type;
    Vec2 center;
    value_type r;

    Circle() = default;
    explicit constexpr Circle(value_type r) : center(0.0, 0.0), r(r) {}
    constexpr Circle(value_type x, value_type y, value_type r) : center(x, y), r(r) {}
    constexpr Circle(const Vec2& center, value_type r) : center(center), r(r) {}

    constexpr bool intersects(const Line& line) const { return sgn(line.distanceFromSq(center) - r * r) <= 0; }

    constexpr bool intersects(const Circle& circle) const {
        const value_type d = center.distanceFromSq(circle.center);

        return sgn(square(r - circle.r) - d) <= 0 && sgn(d - square(r + circle.r)) <= 0;
    }

    constexpr bool circumcribes(const Circle& circle) const { return same(center.distanceFromSq(circle.center), square(r + circle.r)); }

    constexpr bool inscribes(const Circle& circle) const { return same(center.distanceFromSq(circle.center), square(r - circle.r)); }

    constexpr bool contains(const Circle& circle) const {
        return 0 < sgn(square(r - circle.r) - center.distanceFromSq(circle.center)) && 0 < sgn(r - circle.r);
    }

    constexpr value_type area() const { return Pi * r * r; }

    value_type commonArea(const Circle& circle) const {
        const value_type d_sq = center.distanceFromSq(circle.center);
        const value_type d = center.distanceFrom(circle.center);

        const value_type r1 = r;
        const value_type r2 = circle.r;

        if (sgn(d_sq - square(r1 + r2)) >= 0) return 0.0;
        if (sgn(d_sq - square(r1 - r2)) <= 0) return min(this->area(), circle.area());

        const value_type arg1 = acos(((r1 - r2) * (r1 + r2) + d_sq) / (2 * r1 * d));
        const value_type arg2 = acos(((r2 - r1) * (r2 + r1) + d_sq) / (2 * r2 * d));

        return r1 * r1 * (arg1 - sin(2 * arg1) / 2) + r2 * r2 * (arg2 - sin(2 * arg2) / 2);
    }

    constexpr Circle& moveBy(const Vec2& v) {
        center += v;
        return *this;
    }
    constexpr Circle movedBy(const Vec2& v) const { return {center + v, r}; }

    optional<vector<Vec2>> intersectsAt(const Line& line) const {
        if (!intersects(line)) return nullopt;

        vector<Vec2> res;

        const Vec2 v = line.projection(center);

        if (same(line.distanceFrom(center), r))
            res.emplace_back(v);
        else {
            value_type d = sqrt(r * r - (v - center).lengthSq());
            const Vec2 e = line.vector().normalized();

            res.emplace_back(v - d * e);
            res.emplace_back(v + d * e);
        }

        return res;
    }

    optional<vector<Vec2>> intersectsAt(const Circle& circle) const {
        if (!intersects(circle)) return nullopt;

        const value_type d = center.distanceFrom(circle.center), arg = (circle.center - center).arg(),
                         theta = acos((d * d + r * r - circle.r * circle.r) / (2 * d * r));

        vector<Vec2> res;
        res.emplace_back(center + r * Vec2(arg + theta));
        res.emplace_back(center + r * Vec2(arg - theta));

        if (res[0] > res[1]) swap(res[0], res[1]);

        return res;
    }

    optional<vector<Vec2>> tangentPointFrom(const Vec2& v) const {
        const value_type d = center.distanceFromSq(v);

        if (sgn(d - r * r) < 0) return nullopt;
        if (same(d, r * r)) return vector<Vec2>{v};

        const auto [x1, y1] = v - center;

        const auto& opt = Circle(r).intersectsAt(Line(x1, y1, -r * r));

        vector<Vec2> res = opt.value();

        for (Vec2& v : res) v += center;

        if (res[0] > res[1]) swap(res[0], res[1]);

        return res;
    }
    optional<vector<Vec2>> commonTangentPointFrom(const Circle& circle) const {
        const value_type r1 = r, r2 = circle.r;

        vector<Vec2> res;

        if (!same(r1, r2)) {
            const Vec2 p((r2 * center - r1 * circle.center) / (r2 - r1));

            const auto& opt = tangentPointFrom(p);

            if (opt.has_value()) {
                for (const Vec2& vec : opt.value()) {
                    res.emplace_back(vec);
                }
            }
        } else {
            const value_type theta = (circle.center - center).arg();

            res.emplace_back(center + r1 * Vec2(theta + 90_deg));
            res.emplace_back(center + r1 * Vec2(theta - 90_deg));
        }

        const Vec2 q((r2 * center + r1 * circle.center) / (r1 + r2));

        const auto& opt = tangentPointFrom(q);

        if (opt.has_value()) {
            for (const Vec2& vec : opt.value()) {
                res.emplace_back(vec);
            }
        }

        if (res.empty()) return nullopt;

        sort(res.begin(), res.end());

        return res;
    }

    friend istream& operator>>(istream& is, Circle& rhs) { return is >> rhs.center >> rhs.r; }
};

struct Polygon {
    using value_type = Vec2::value_type;
    int n;
    vector<Vec2> vertex;

    Polygon() = default;
    Polygon(int _n) : n(_n), vertex(_n) {}
    Polygon(const vector<Vec2>& vec) : n(static_cast<int>(vec.size())), vertex(vec) {}

    Line side(size_t index) const { return Line(vertex[index], vertex[(index + 1) % n]); }

    Polygon& moveBy(const Vec2& v) {
        for (Vec2& vec : vertex) vec += v;
        return *this;
    }
    Polygon movedBy(const Vec2& v) const {
        vector<Vec2> new_vertex;
        for (const Vec2& vec : vertex) new_vertex.emplace_back(vec + v);

        return Polygon(new_vertex);
    }

    bool isConvex() const {
        for (int i = 0; i < n; ++i) {
            if (ccw(vertex[i], vertex[(i + 1) % n], vertex[(i + 2) % n]) == -1) return false;
        }
        return true;
    }

    bool isOnEdge(const Vec2& v) const {
        for (int i = 0; i < n; ++i) {
            if (ccw(vertex[i], vertex[(i + 1) % n], v) == 0) return true;
        }
        return false;
    }

    bool intersects(const Vec2& v) const {
        floating_point_type sum = 0.0;

        for (int i = 0; i < n; ++i) {
            sum += v.arg(vertex[i], vertex[(i + 1) % n]);
        }

        return sgn(sum - 2.0 * Pi) == 0;
    }

    double area() const {
        value_type sum = 0.0;

        for (int i = 0; i < n; ++i) {
            sum += vertex[i].cross(vertex[i == n - 1 ? 0 : i + 1]);
        }

        return 0.5 * fabs(sum);
    }

    value_type commonArea(const Circle& circle) const {
        if (n < 3) return 0.0;

        if (!same(circle.center.x, 0.0) || !same(circle.center.y, 0.0)) {
            return (*this).movedBy(-circle.center).commonArea(Circle(circle.r));
        }

        auto cross_area = [&](auto self, Circle c, Vec2 a, Vec2 b) -> value_type {
            const Vec2 va = c.center - a, vb = c.center - b;

            value_type f = va.cross(vb), res = 0.0;

            if (same(f, 0.0)) return 0.0;
            if (sgn(max(va.length(), vb.length()) - c.r) <= 0) return f;

            const Line line(a, b);

            if (sgn(segment::distance(line, c.center) - c.r) >= 0) {
                return c.r * c.r * va.arg(vb);
            }

            const auto opt = c.intersectsAt(line);
            vector<Vec2> vec1 = opt.value();

            const vector<Vec2> vec2{a, vec1.front(), vec1.back(), b};

            for (int i = 0; i + 1 < vec2.size(); ++i) {
                res += self(self, c, vec2[i], vec2[i + 1]);
            }

            return res;
        };

        value_type sum = 0.0;

        for (int i = 0; i < n; ++i) {
            sum += cross_area(cross_area, circle, vertex[i], vertex[(i + 1) % n]);
        }

        sum *= 0.5;

        return fabs(sum);
    }

    Polygon convexHull() const { return convex_hull(vertex); }

    Polygon convexCut(const Line& line) const {
        assert(isConvex());

        vector<Vec2> res;

        for (int i = 0; i < n; ++i) {
            const Vec2 &now = vertex[i], &nxt = vertex[(i + 1) % n];

            if (ccw(line.begin, line.end, now) != -1) res.emplace_back(now);
            if (ccw(line.begin, line.end, now) * ccw(line.begin, line.end, nxt) < 0) {
                const auto& opt = Line(now, nxt).intersectsAt(line);
                if (opt.has_value()) res.emplace_back(opt.value());
            }
        }

        return Polygon(res);
    }

    value_type diameter() const {
        const auto convex = (isConvex() ? (*this) : convexHull()).vertex;

        const size_t n = convex.size();

        if (n == 2)
            return convex[0].distanceFrom(convex[1]);
        else {
            size_t i = 0, j = 0;

            for (size_t k = 0; k < n; ++k) {
                if (!(convex[i] < convex[k])) i = k;
                if (convex[j] < convex[k]) j = k;
            }

            value_type res = 0.0;

            const size_t si = i, sj = j;

            while (i != sj || j != si) {
                res = max(res, convex[i].distanceFrom(convex[j]));

                if ((convex[(i + 1) % n] - convex[i]).cross(convex[(j + 1) % n] - convex[j]) < 0) {
                    i = (i + 1) % n;
                } else
                    j = (j + 1) % n;
            }

            return res;
        }
    }

    friend istream& operator>>(istream& is, Polygon& rhs) {
        for (Vec2& e : rhs.vertex) is >> e;
        return is;
    }
};

// x座標でsort済み
floating_point_type distance_closest_pair(vector<Vec2>& points, int left, int right) {
    if (right - left <= 1) return 1e20;

    int mid = (left + right) / 2;
    floating_point_type x = points[mid].x;
    floating_point_type d = min(distance_closest_pair(points, left, mid), distance_closest_pair(points, mid, right));

    inplace_merge(points.begin() + left, points.begin() + mid, points.begin() + right,
                  [](const Vec2& a, const Vec2& b) { return sgn(a.y - b.y) < 0; });

    vector<Vec2> a;

    for (int i = left; i < right; ++i) {
        if (sgn(fabs(points[i].x - x) - d) >= 0) continue;

        for (int j = static_cast<int>(a.size()) - 1; j >= 0; --j) {
            if (sgn(fabs((points[i] - a[j]).y) - d) >= 0) break;
            d = min(d, points[i].distanceFrom(a[j]));
        }

        a.emplace_back(points[i]);
    }

    return d;
}

// 垂直または水平線分の交点
// begin < end
vector<Vec2> intersections(const vector<Line>& lines) {
    const int n = static_cast<int>(lines.size());

    vector<pair<floating_point_type, int>> events;

    for (int i = 0; i < n; ++i) {
        const Line& line = lines[i];

        if (same(line.begin.y, line.end.y)) {  // 水平
            events.emplace_back(make_pair(line.begin.x, i));
            events.emplace_back(make_pair(line.end.x, i + 2 * n));
        } else {  // 垂直
            events.emplace_back(make_pair(line.begin.x, i + n));
        }
    }

    sort(events.begin(), events.end());

    set<floating_point_type> y_list;
    vector<Vec2> res;

    for (int i = 0; i < static_cast<int>(events.size()); ++i) {
        const int kind = events[i].second;
        const int id = kind % n;
        const Line& line = lines[id];

        if (kind < n) {  // 左端
            y_list.insert(line.begin.y);
        } else if (kind < 2 * n) {  // 垂直
            for (auto y : y_list) {
                if (line.begin.y - EPS <= y && y <= line.end.y + EPS) {
                    res.emplace_back(Vec2(line.begin.x, y));
                }
            }
        } else {  // 右端
            y_list.erase(line.end.y);
        }
    }

    return res;
}
}  // namespace geometry

using namespace geometry;
using Point = Vector2D<ll>;
void solve(int n) {
    vector<Point> p(n);
    for (auto& e : p) cin >> e;
    vector<Point> p2(2 * n);
    rep(i, n) p2[i] = p2[i + n] = p[i];
    auto c = convex_hull(p);
    int m = c.size();
    vector<int> ind(m);
    rep(i, m) {
        rep(j, n) {
            if (c[i] == p[j]) {
                ind[i] = j;
                break;
            }
        }
    }
    rep(i, m) {
        int a = ind[i], b = ind[(i + 1) % m];
        if (a > b) b += n;
        if (a + 1 == b) continue;

        int cc1 = ccw(p2[a], p2[a + 1], p2[b]);
        int cc2 = ccw(p2[a], p2[b - 1], p2[b]);

        if ((cc1 == 1 || cc1 == -1) || (cc2 == 1 || cc2 == -1)) {
            cout << "No\n";
            return;
        }
    }
    cout << "Yes\n";
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m, k, p, q;
    string s;
    while (cin >> n) {
        if (n == 0) break;
        solve(n);
    }
}
accuracy: 1
time_ms: 10
memory_kb: 3520
final_rank: 7

code_snippet: #line 2 "cp-library/src/cp-template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull  = unsigned long long;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
template < class T > bool chmin(T& a, T b) { if(a > b) { a = b; return true; } return false; }
template < class T > bool chmax(T& a, T b) { if(a < b) { a = b; return true; } return false; }
template < class T, class U > T ceil (T x, U y) { return (x > 0 ? (x + y - 1) / y :           x / y); }
template < class T, class U > T floor(T x, U y) { return (x > 0 ?           x / y : (x - y + 1) / y); }
int popcnt(i32 x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(i64 x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }

#line 2 "cp-library/src/utility/rep_itr.hpp"
template < class T > struct itr_rep {
    T i, d;
    constexpr itr_rep(const T i) noexcept : i(i), d(1) {}
    constexpr itr_rep(const T i, const T d) noexcept : i(i), d(d) {}
    void operator++() noexcept { i += d; }
    constexpr int operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr_rep x) const noexcept { return d > 0 ? i < x.i : i > x.i; }
};

template < class T > struct rep {
    const itr_rep< T > s, t;
    constexpr rep(const T t) noexcept : s(0), t(t) {}
    constexpr rep(const T s, const T t) noexcept : s(s), t(t) {}
    constexpr rep(const T s, const T t, const T d) noexcept : s(s, d), t(t, d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};

template < class T > struct revrep {
    const itr_rep < T > s, t;
    constexpr revrep(const T t) noexcept : s(t - 1, -1), t(-1, -1) {}
    constexpr revrep(const T s, const T t) noexcept : s(t - 1, -1), t(s - 1, -1) {}
    constexpr revrep(const T s, const T t, const T d) noexcept : s(t - 1, -d), t(s - 1, -d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};
#line 3 "cp-library/src/utility/io.hpp"

/* 128bit integer */
istream& operator>>(istream& is, i128& x) {
    std::string s; is >> s;
    int pm = (s[0] == '-');
    x = 0;
    for(int i : rep(pm, int(s.size()))) x = x * 10 + (s[i] - '0');
    if(pm) x *= -1;
    return is;
}
ostream& operator<<(ostream& os, const i128& x) {
    if(x == 0) return os << '0';
    i128 y = x;
    if(y < 0) { os << '-'; y *= -1; }
    std::vector<int> ny;
    while(y > 0) { ny.push_back(y % 10); y /= 10; }
    for(int i : revrep(ny.size())) os << ny[i];
    return os;
}

template < class S, class T > istream& operator>>(istream& is,       std::pair< S, T >& x) { is >> x.first        >> x.second; return is; }
template < class S, class T > ostream& operator<<(ostream& os, const std::pair< S, T >& x) { os << x.first << " " << x.second; return os; }

namespace scanner {
    struct sca {
        template < class T > operator T() {
            T s; std::cin >> s; return s;
        }
    };
    struct vec {
        int n;
        vec(int n) : n(n) {}
        template < class T > operator std::vector< T >() {
            std::vector< T > v(n);
            for(T& x : v) std::cin >> x;
            return v;
        }
    };
    struct mat {
        int h, w;
        mat(int h, int w) : h(h), w(w) {}
        template < class T > operator std::vector< std::vector< T > >() {
            std::vector m(h, std::vector< T >(w));
            for(std::vector< T >& v : m) for(T& x : v) std::cin >> x;
            return m;
        }
    };
    struct speedup {
        speedup() {
            std::cin.tie(0);
            std::ios::sync_with_stdio(0);
        }
    } speedup_instance;
}
scanner::sca in() { return scanner::sca(); }
scanner::vec in(int n) { return scanner::vec(n); }
scanner::mat in(int h, int w) { return scanner::mat(h, w); }

namespace printer {
    void precision(int d) { std::cout << std::fixed << std::setprecision(d); }
    void flush() { std::cout.flush(); }
}

template < class T >
ostream& operator<<(ostream& os, const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) { os << a[i]; if(i != n - 1) os << ' '; }
    return os;
}

int print() { std::cout << '\n'; return 0; }
template < class head, class... tail > int print(head&& h, tail&&... t) {
    std::cout << h; if(sizeof...(tail)) std::cout << ' ';
    return print(std::forward<tail>(t)...);
}
template < class T > int print_n(const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) std::cout << a[i] << "\n";
    return 0;
}


#line 2 "cp-library/src/utility/key_val.hpp"

template < class K, class V >
struct key_val {
    K key; V val;
    key_val() {}
    key_val(K key, V val) : key(key), val(val) {}
    template < std::size_t Index >
    std::tuple_element_t< Index, key_val >& get() {
        if constexpr (Index == 0) return key;
        if constexpr (Index == 1) return val;
    }
};

namespace std {

template < class K, class V > struct tuple_size < key_val< K, V > > : integral_constant< size_t, 2 > {};
template < class K, class V > struct tuple_element < 0, key_val< K, V > > { using type = K; };
template < class K, class V > struct tuple_element < 1, key_val< K, V > > { using type = V; };

}
#line 2 "cp-library/src/utility/vec_op.hpp"
template < class T > key_val< int, T > max_of(const vector< T >& a) {
    int i = std::max_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class T > key_val< int, T > min_of(const vector< T >& a) {
    int i = std::min_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class S, class T > S sum_of(const vector< T >& a) {
    S sum = 0;
    for(const T x : a) sum += x;
    return sum;
}
template < class S, class T > vector< S > freq_of(const vector< T >& a, T L, T R) {
    vector< S > res(R - L, S(0));
    for(const T x : a) res[x - L] += 1;
    return res;
}
template < class S, class T > struct prefix_sum {
    vector< S > s;
    prefix_sum(const vector< T >& a) : s(a) {
        s.insert(s.begin(), S(0));
        for(int i : rep(a.size())) s[i + 1] += s[i];
    }
    // [L, R)
    S sum(int L, int R) { return s[R] - s[L]; }
};
#line 3 "cp-library/src/utility/heap.hpp"

template < class T > using heap_min = std::priority_queue< T, std::vector< T >, std::greater< T > >;
template < class T > using heap_max = std::priority_queue< T, std::vector< T >, std::less< T > >;

#line 27 "cp-library/src/cp-template.hpp"

#line 1 "cp-library/src/algorithm/bin_search.hpp"
template < class T, class F >
T bin_search(T ok, T ng, F f) {
    while(abs(ng - ok) > 1) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}

template < class T, class F >
T bin_search_real(T ok, T ng, F f, int step = 80) {
    while(step--) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}
#line 2 "cp-library/src/algorithm/argsort.hpp"

template < class T > std::vector< int > argsort(const std::vector< T > &a) {
    std::vector< int > ids((int)a.size());
    std::iota(ids.begin(), ids.end(), 0);
    std::sort(ids.begin(), ids.end(), [&](int i, int j) {
        return a[i] < a[j] || (a[i] == a[j] && i < j);
    });
    return ids;
}
#line 1 "macro.hpp"
namespace macro {

using size_type = int;
template < class container > void  sort(container& a) { std::sort(std:: begin(a), std:: end(a)); }
template < class container > void rsort(container& a) { std::sort(std::rbegin(a), std::rend(a)); }
template < class container > void reverse(container& a) { std::reverse(std::begin(a), std::end(a)); }
template < class container > void unique(container& a) {
    std::sort(std::begin(a), std::end(a));
    a.erase(std::unique(std::begin(a), std::end(a)), std::end(a));
}
template < class container > container  sorted(const container& a) { container b = a;  sort(b); return std::move(b); }
template < class container > container rsorted(const container& a) { container b = a; rsort(b); return std::move(b); }
template < class container, class compare > void sort(container& a, const compare& cmp) { std::sort(std::begin(a), std::end(a), cmp); }
template < class container, class compare > container sorted(const container& a, const compare& cmp) { container b = a; sort(b, cmp); return std::move(b); }
template < class container, class value > size_type lower_bound(const container& a, const value& x) { return std::lower_bound(std::begin(a), std::end(a), x) - std::begin(a); }
template < class container, class value > size_type upper_bound(const container& a, const value& x) { return std::upper_bound(std::begin(a), std::end(a), x) - std::begin(a); }

const std::vector<std::pair<size_type, size_type>> dir4 = { {+1,  0}, {-1,  0}, { 0, +1}, { 0, -1} };
const std::vector<std::pair<size_type, size_type>> dir8 = { {-1, -1}, {-1,  0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1,  0}, {+1, +1} };

#ifdef _DEBUG
#define debug(x) std::cout << "[" << __LINE__ << "] " << #x << ": " << x << std::endl
#else
#define debug(x)
#endif

template < class container > void concat(container& a, const container& b) {
    a.insert(std::end(a), std::begin(b), std::end(b));
}
std::vector<size_type> iota(const size_type n) {
    std::vector<size_type> I(n);
    std::iota(std::begin(I), std::end(I), 0);
    return I;
}
template < class container > std::vector<size_type> sort_idx(const container& a) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return a[i] < a[j] or (a[i] == a[j] and i < j); });
    return I;
}
template < class container, class compare > std::vector<size_type> sort_idx(const container& a, const compare& cmp) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return cmp(a[i], a[j]) or (a[i] == a[j] and i < j); });
    return std::move(I);
}

struct grid {
    using size_type = int;
    size_type H, W;
    grid(const size_type H, const size_type W) : H(H), W(W) {}
    bool contains(const size_type i, const size_type j) {
        return 0 <= i and i < H and 0 <= j and j < W;
    }
};

using f64 = long double;

template < class T > vector< T >& operator++(vector< T >& a) { for(T& x : a) x++; return a; }
template < class T > vector< T >& operator--(vector< T >& a) { for(T& x : a) x--; return a; }
template < class T > vector< T >  operator++(vector< T >& a, signed) { vector< T > res = a; for(T& x : a) x++; return res; }
template < class T > vector< T >  operator--(vector< T >& a, signed) { vector< T > res = a; for(T& x : a) x--; return res; }

} // namespace macro

using namespace macro;
#line 3 "A.cpp"

template < class T > struct point {
    T x, y;
    point() : x(0), y(0) {}
    point(T x, T y) : x(x), y(y) {}
    point(std::pair< T, T > p) : x(p.first), y(p.second) {}
    point& operator+=(const point& p) { x += p.x, y += p.y; return *this; }
    point& operator-=(const point& p) { x -= p.x, y -= p.y; return *this; }
    point& operator*=(const T r) { x *= r, y *= r; return *this; }
    point& operator/=(const T r) { x /= r, y /= r; return *this; }
    point operator+(const point& p) const { return point(*this) += p; }
    point operator-(const point& p) const { return point(*this) -= p; }
    point operator*(const T r) const { return point(*this) *= r; }
    point operator/(const T r) const { return point(*this) /= r; }
    point operator-() const { return {-x, -y}; }
    bool operator==(const point& p) const { return x == p.x and y == p.y; }
    bool operator!=(const point& p) const { return x != p.x or  y != p.y; }
    bool operator<(const point& p) const { return x == p.x ? y < p.y : x < p.x; }
    point< T > rot(double theta) {
        static_assert(is_floating_point_v< T >);
        double cos_ = std::cos(theta), sin_ = std::sin(theta);
        return {cos_ * x - sin_ * y, sin_ * x + cos_ * y};
    }
};
template < class T > istream& operator>>(istream& is, point< T >& p) { return is >> p.x >> p.y; }
template < class T > ostream& operator<<(ostream& os, point< T >& p) { return os << p.x << " " << p.y; }
template < class T > T dot(const point< T >& a, const point< T >& b) { return a.x * b.x + a.y * b.y; }
template < class T > T det(const point< T >& a, const point< T >& b) { return a.x * b.y - a.y * b.x; }
template < class T > T norm(const point< T >& p) { return p.x * p.x + p.y * p.y; }
template < class T > double abs(const point< T >& p) { return std::sqrt(norm(p)); }
template < class T > double angle(const point< T >& p) { return std::atan2(p.y, p.x); }
template < class T > int sign(const T x) {
    T e = (is_integral_v< T > ? 1 : 1e-8);
    if(x <= -e) return -1;
    if(x >= +e) return +1;
    return 0;
}
template < class T > bool equals(const T& a, const T& b) { return sign(a - b) == 0; }
template < class T > int ccw(const point< T >& a, point< T > b, point< T > c) {
    b -= a, c -= a;
    if(sign(det(b, c)) == +1) return +1; // counter clockwise
    if(sign(det(b, c)) == -1) return -1; //         clockwise
    if(sign(dot(b, c)) == -1) return +2; // c-a-b
    if(norm(b) < norm(c)) return -2;     // a-b-c
    return 0;                            // a-c-b
}

template < class T > struct line {
    point< T > a, b;
    line() {}
    line(point< T > a, point< T > b) : a(a), b(b) {}
};
template < class T > point< T > projection(const line< T >& l, const point< T >& p) {
    static_assert(is_floating_point_v< T >);
    return l.a + (l.a - l.b) * dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
}
template < class T > point< T > reflection(const line< T >& l, const point< T >& p) {
    static_assert(is_floating_point_v< T >);
    return p + (projection(l, p) - p) * T(2);
}
template < class T > bool orthogonal(const line< T >& a, const line< T >& b) { return equals(dot(a.b - a.a, b.b - b.a), T(0)); }
template < class T > bool parallel  (const line< T >& a, const line< T >& b) { return equals(det(a.b - a.a, b.b - b.a), T(0)); }
template < class T > point< T > cross_point_ll(const line< T >& l, const line< T >& m) {
    static_assert(is_floating_point_v< T >);
    T A = det(l.b - l.a, m.b - m.a);
    T B = det(l.b - l.a, l.b - m.a);
    if(equals(abs(A), T(0)) and equals(abs(B), T(0))) return m.a;
    return m.a + (m.b - m.a) * B / A;
}

template < class T > using segment = line< T >;
template < class T > bool intersect_ss(const segment< T >& s, const segment< T >& t) {
    return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 and ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}
template < class T > double distance_sp(const segment< T >& s, const point< T >& p) {
    static_assert(is_floating_point_v< T >);
    point r = projection(s, p);
    if(ccw(s.a, s.b, r) == 0) return abs(r - p);
    return std::min(abs(s.a - p), abs(s.b - p));
}
template < class T > double distance_ss(const segment< T >& a, const segment< T >& b) {
    if(intersect_ss(a, b)) return 0;
    return std::min({ distance_sp(a, b.a), distance_sp(a, b.b), distance_sp(b, a.a), distance_sp(b, a.b) });
}

template < class T > using polygon = std::vector< point< T > >;
template < class T > T area2(const polygon< T >& p) {
    T s = 0;
    int n = p.size();
    for(int i = 0; i < n; i++) s += det(p[i], p[(i + 1) % n]);
    return s;
}
template < class T > T area(const polygon< T >& p) { return area2(p) / T(2); }

template < class T > bool is_convex(const polygon< T >& p) {
    int n = p.size();
    for(int i = 0; i < n; i++) if(ccw(p[(i - 1 + n) % n], p[i], p[(i + 1) % n]) == -1) return false;
    return true;
}
template < class T > int contains(const polygon< T >& g, const point< T >& p) {
    int n = g.size();
    bool in = false;
    for(int i = 0; i < n; i++) {
        point a = g[i] - p, b = g[(i + 1) % n] - p;
        if(sign(a.y - b.y) == +1) std::swap(a, b);
        if(sign(a.y) <= 0 and sign(b.y) ==+1 and sign(det(a, b)) == -1) in = !in;
        if(sign(det(a, b)) == 0 and sign(dot(a, b)) <= 0) return 1; // ON
    }
    return in ? 2 : 0;
}
template < class T > polygon< T > convex_cut(const polygon< T >& p, const line< T >& l) {
    int n = p.size();
    polygon< T > res;
    for(int i = 0; i < n; i++) {
        point now = p[i], nxt = p[(i + 1) % n];
        if(ccw(l.a, l.b, now) != -1) res.push_back(now);
        if(ccw(l.a, l.b, now) * ccw(l.a, l.b, nxt) < 0) res.push_back(cross_point_ll(line(now, nxt), l));
    }
    return res;
}
template < class T > polygon< T > convex_hull(polygon< T > p) {
    int n = p.size(), k = 0;
    if(n <= 2) return p;
    std::sort(p.begin(), p.end());
    polygon< T > ch(n + n);
    for(int i = 0; i < n; ch[k++] = p[i++])
        while(k >= 2 and sign(det(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1])) == -1) k--;
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--])
        while(k >= t and sign(det(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1])) == -1) k--;
    ch.resize(k - 1);
    return ch;
}
template < class T > T diameter2(const polygon< T >& p) {
    static_assert(is_floating_point_v< T >);
    int n = p.size(), is = 0, js = 0;
    for(int i = 1; i < n; i++) {
        if(sign(p[i].y - p[is].y) == +1) is = i;
        if(sign(p[i].y - p[js].y) == -1) js = i;
    }
    T dist_max = norm(p[is] - p[js]);
    int maxi = is, i = is, maxj = js, j = js;
    do {
        if(sign(det(p[(i + 1) % n] - p[i], p[(j + 1) % n] - p[j])) >= 0) j = (j + 1) % n; else i = (i + 1) % n;
        if(norm(p[i] - p[j]) > dist_max) {
            dist_max = norm(p[i] - p[j]);
            maxi = i, maxj = j;
        }
    } while(i != is or j != js);
    return dist_max;
}
template < class T > double diameter(const polygon< T >& p) {
    static_assert(is_floating_point_v< T >);
    return std::sqrt(diameter2(p));
}

template < class T > struct circle {
    point< T > p;
    T r;
    circle() = default;
    circle(point< T > p, T r) : p(p), r(r) {}
};
template < class T > istream& operator>>(istream& is, circle< T >& c) { return is >> c.p >> c.r; }
template < class T > int intersect_cc(circle< T > c1, circle< T > c2) {
    if(c1.r < c2.r) std::swap(c1, c2);
    T d = abs(c1.p - c2.p);
    if(sign(c1.r + c2.r - d) == -1) return 4;
    if(equals(c1.r + c2.r, d)) return 3;
    if(sign(c1.r - c2.r - d) == -1) return 2;
    if(equals(c1.r - c2.r, d)) return 1;
    return 0;
}
template < class T > std::pair<point< T >, point< T >> cross_point_cc(const circle< T >& c1, const circle< T >& c2) {
    T d = abs(c1.p - c2.p);
    T a = std::acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    T t = angle(c2.p - c1.p);
    point< T > p1 = c1.p + point< T >(std::cos(t + a), std::sin(t + a)) * c1.r;
    point< T > p2 = c1.p + point< T >(std::cos(t - a), std::sin(t - a)) * c1.r;
    return {p1, p2};
}

bool solve(int n) {
    vector<point<int>> p = in(n);
    vector<point<int>> c = convex_hull(p);
    const int m = c.size();

    auto is_on = [&](point<int> a, point<int> b, point<int> c) {
        return abs(ccw(a, b, c)) != 1;
    };

    for(int j : rep(m)) {
        point<int> a = c[j], b = c[(j + 1) % m];
        int cnt = 0;
        for(int i : rep(n)) {
            if(is_on(a, b, p[i])) cnt += 1;
        }
        for(int i : rep(n)) {
            if(is_on(a, b, p[i]) and is_on(a, b, p[(i + 1) % n])) {
                cnt -= 2;
            }
        }
        if(cnt >= 1) return false;
    }
    return true;
}

int main() {
    while(true) {
        int n = in(); if(n == 0) return 0;
        print(solve(n) ? "Yes" : "No");
    }
}
accuracy: 1
time_ms: 20
memory_kb: 3468
final_rank: 6