Open Binary and Object Group organizes a programming contest every year. Mr. Hex belongs to this group and joins the judge team of the contest. This year, he created a geometric problem with its solution for the contest. The problem required a set of points forming a line-symmetric polygon for the input. Preparing the input for this problem was also his task. The input was expected to cover all edge cases, so he spent much time and attention to make them satisfactory.

However, since he worked with lots of care and for a long time, he got tired before he finished. So He might have made mistakes - there might be polygons not meeting the condition. It was not reasonable to prepare the input again from scratch. The judge team thus decided to find all line-asymmetric polygons in his input and fix them as soon as possible. They asked a programmer, just you, to write a program to find incorrect polygons.

You can assume the following:

* Edges of the polygon must not cross or touch each other except for the end points of adjacent edges.
* It is acceptable for the polygon to have adjacent three vertexes on a line, but in such a case, there must be the vertex symmetric to each of them.



Input

The input consists of a set of points in the following format.

N
x1 y1
x2 y2
...
xN yN


The first line of the input contains an integer N (3 ≤ N ≤ 1000), which denotes the number of points. The following N lines describe each point. The i-th line contains two integers x1, y1 (-10000 ≤ xi, yi ≤ 10000), which denote the coordinates of the i-th point.

Note that, although the points are the vertexes of a polygon, they are given in an artibrary order, not necessarily clockwise or counterclockwise.

Output

Output "Yes" in a line if the points can form a line-symmetric polygon, otherwise output "No".

Examples

Input

4
0 1
1 0
0 0
1 1


Output

Yes


Input

4
0 1
1 -1
0 0
1 1


Output

No


Input

9
-1 1
0 1
1 1
-1 0
0 0
1 0
-1 -1
0 -1
1 -1


Output

No


Input

3
-1 -1
0 0
1 1


Output

No


Input

4
0 2
0 0
-1 0
1 0


Output

Yes
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;

#define DE 1
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(__typeof__(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}
template<class T> ostream& operator<<(ostream &s, set<T> P) {s<<"{ ";for(__typeof__(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<*it;}return s<<" }"<<endl;}



const double EPS = 1e-10;
const double PI = acos(-1.0);
double torad(int deg) {return (double)(deg) * PI / 180;}
double todeg(double ang) {return ang * 180 / PI;}
int cast(double num) {
    if (num >= 0) return (int)(num + EPS);
    else return -(int)(-num + EPS);
}

struct Point {
    double x, y;
    Point(double x = 0.0, double y = 0.0) : x(x), y(y) {}
    friend ostream& operator << (ostream &s, const Point &p) {return s << '(' << p.x << ", " << p.y << ')';}
};

Point operator + (Point p, Point q) {return Point(p.x + q.x, p.y + q.y);}
Point operator - (Point p, Point q) {return Point(p.x - q.x, p.y - q.y);}
Point operator * (Point p, double a) {return Point(p.x * a, p.y * a);}
Point operator * (double a, Point p) {return Point(a * p.x, a * p.y);}
Point operator * (Point p, Point q) {return Point(p.x * q.x - p.y * q.y, p.x * q.y + p.y * q.x);}
Point operator / (Point p, double a) {return Point(p.x / a, p.y / a);}
Point conj(Point p) {return Point(p.x, -p.y);}
Point rot(Point p, double ang) {return Point(cos(ang) * p.x - sin(ang) * p.y, sin(ang) * p.x + cos(ang) * p.y);}
Point rot90(Point p) {return Point(-p.y, p.x);}
double cross(Point p, Point q) {return p.x * q.y - p.y * q.x;}
double dot(Point p, Point q) {return p.x * q.x + p.y * q.y;}
double norm(Point p) {return dot(p, p);}
double abs(Point p) {return sqrt(dot(p, p));}
bool eq(Point p, Point q) {return abs(p - q) < EPS;}
double amp(Point p) {double res = atan2(p.y, p.x); if (res < 0) res += PI*2; return res;}
bool operator < (Point p, Point q) {return (abs(p.x - q.x) > EPS ? p.x < q.x : p.y < q.y);}
bool operator > (Point p, Point q) {return (abs(p.x - q.x) > EPS ? p.x > q.x : p.y > q.y);}
Point operator / (Point p, Point q) {return p * conj(q) / norm(q);}


struct Line : vector<Point> {
    Line(Point a = Point(0.0, 0.0), Point b = Point(0.0, 0.0)) {
        this->push_back(a);
        this->push_back(b);
    }
};


vector<Point> convexhull_All(vector<Point> ps) {
    int n = ps.size();
    vector<Point> res(2*n);
    sort(ps.begin(), ps.end());
    int k = 0;
    for (int i = 0; i < n; ++i) {
        if (k >= 2) {
            while (cross(res[k-1] - res[k-2], ps[i] - res[k-2]) < -EPS) {
                --k;
                if (k < 2) break;
            }
        }
        res[k] = ps[i]; ++k;
    }
    int t = k+1;
    for (int i = n-2; i >= 0; --i) {
        if (k >= t) {
            while (cross(res[k-1] - res[k-2], ps[i] - res[k-2]) < -EPS) {
                --k;
                if (k < t) break;
            }
        }
        res[k] = ps[i]; ++k;
    }
    res.resize(k-1);
    return res;
}


Point proj(Point p, Line l) {
    double t = dot(p - l[0], l[1] - l[0]) / norm(l[1] - l[0]);
    return l[0] + (l[1] - l[0]) * t;
}
Point refl(Point p, Line l) {
    return p + (proj(p, l) - p) * 2;
}

double distancePL(Point p, Line l) {
    return abs(p - proj(p, l));
}



int N;
double x, y;

int main() {
    while (cin >> N) {
        set<pint> se;
        vector<Point> ps(N);
        for (int i = 0; i < N; ++i) {
            cin >> x >> y;
            se.insert(MP(x, y));
            ps[i] = Point(x, y);
        }
        bool res = false;
        
        vector<Point> ch = convexhull_All(ps);
        int n = ch.size();
        vector<Point> mid(n), mch;
        for (int i = 0; i < n; ++i) mid[i] = (ch[i] + ch[(i+1)%n]) / 2;
        for (int i = 0; i < n; ++i) {mch.PB(ch[i]); mch.PB(mid[i]);}
        
        for (int i = 0; i < n; ++i) {
            Line l(mch[i], mch[i+n]);
            if (eq(l[0], l[1])) continue;
            int con = 0;
            EACH(it, se) {
                pint ip = *it;
                Point p(ip.FI, ip.SE);
                if (distancePL(p, l) < EPS) ++con;
            }
            if (con >= 3) continue;
            
            bool ok = true;
            EACH(it, se) {
                pint ip = *it;
                Point p(ip.FI, ip.SE);
                Point q = refl(p, l);
                pint iq(cast(q.x), cast(q.y));
                if (abs(iq.FI - q.x) > EPS || abs(iq.SE - q.y) > EPS) {ok = false; break;}
                if (!se.count(iq)) {ok = false; break;}
            }

            if (ok) {res = true; break;}
        }
        
        if (res) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    
    return 0;
}
