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 <bits/stdc++.h>
#define int long long
using namespace std;

template<class T = int>
struct rational{
	T gcd(T a,T b){ return b ? gcd(b,a % b) : a; }
	T numer,denom;

	rational() : numer(0),denom(1){}
	rational(T n,T d = 1) : numer(n),denom(d){
		normalize();
	}

	void normalize(){
		if(denom == 0){
			numer = 1;
			return;
		}
		if(denom < 0) numer *= -1,denom *= -1;
		T g = gcd(numer < 0 ? -numer : numer,denom);
		if(g == 0) numer = 0,denom = 1;
		else numer /= g,denom /= g;
	}

	operator long long() const{ return (long long)(numer / denom); }

	rational operator-() const{ return rational(*this) *= -1; }

	rational operator+(const rational &x) const{ return rational(*this) += x; }
	rational operator-(const rational &x) const{ return rational(*this) -= x; }
	rational operator*(const rational &x) const{ return rational(*this) *= x; }
	rational operator/(const rational &x) const{ return rational(*this) /= x; }

	rational &operator+=(const rational &x){
		numer = numer * x.denom + x.numer * denom;
		denom *= x.denom;
		normalize();
		return *this;
	}
	rational &operator-=(const rational &x){
		numer = numer * x.denom - x.numer * denom;
		denom *= x.denom;
		normalize();
		return *this;
	}
	rational &operator*=(const rational &x){
		numer *= x.numer;
		denom *= x.denom;
		normalize();
		return *this;
	}
	rational &operator/=(const rational &x){
		numer *= x.denom;
		denom *= x.numer;
		normalize();
		return *this;
	}

	friend ostream &operator<<(ostream &os,const rational &x){
		return os << x.numer << '/' << x.denom;
	}

	bool operator<(const rational &x) const{ return numer * x.denom < x.numer * denom; };
	bool operator>(const rational &x) const{ return numer * x.denom > x.numer * denom; };
	bool operator<=(const rational &x) const{ return numer * x.denom <= x.numer * denom; };
	bool operator>=(const rational &x) const{ return numer * x.denom >= x.numer * denom; };
	bool operator==(const rational &x) const{ return numer * x.denom == x.numer * denom; };
	bool operator!=(const rational &x) const{ return numer * x.denom != x.numer * denom; };
};

template<class T>
struct Complex{
	T x,y;

	Complex() : x(T(0)),y(T(0)){}
	Complex(T x,T y) : x(x),y(y){}

	T real() const{ return x; }
	T imag() const{ return y; }

	Complex operator-() const{ return Complex(*this) *= -1; }

	Complex operator+(const Complex &x) const{ return Complex(*this) += x; }
	Complex operator-(const Complex &x) const{ return Complex(*this) -= x; }
	Complex operator*(const T &x) const{ return Complex(*this) *= x; }
	Complex operator/(const T &x) const{ return Complex(*this) /= x; }

	Complex &operator+=(const Complex &p){
		x += p.x; y += p.y;
		return *this;
	}
	Complex &operator-=(const Complex &p){
		x -= p.x; y -= p.y;
		return *this;
	}
	Complex &operator*=(const T &a){
		x *= a; y *= a;
		return *this;
	}
	Complex &operator/=(const T &a){
		x /= a; y /= a;
		return *this;
	}

	friend ostream &operator<<(ostream &os,const Complex &p){
		return os << '(' << p.x << ',' << p.y << ')';
	}

	bool operator<(const Complex &p) const{ return x == p.x ? y < p.y : x < p.x; };
	bool operator==(const Complex &p) const{ return x == p.x && y == p.y; };
};

using Float = rational<int>;
using Point = Complex<Float>;
struct Line{
	Point a,b;
	Line(Point a,Point b) : a(a),b(b){}
};

Line bisector(Point p1,Point p2){
	Point mid = (p1 + p2) / Float(2),d = p2 - p1;
	return Line(mid,mid + Point(d.imag(),-d.real()));
}

tuple<Float,Float,Float> linear_form(const Line &l){
	if(l.a.real() == l.b.real()) return make_tuple(1,0,-l.a.real());
	Float a = (l.b.imag() - l.a.imag()) / (l.b.real() - l.a.real());
	Float b = l.a.imag() - a * l.a.real();
	return make_tuple(a,-1,b);
}

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

template<class T>
ostream &operator<<(ostream &os,const tuple<T,T,T> &v){
	os << '(' << get<0>(v) << ',' << get<1>(v) << ',' << get<2>(v) << ')';
	return os;
}

signed main(){
	int n;
	Point ps[1010];
	cin >> n;
	for(int i = 0;i < n;i++){
		int a,b;
		cin >> a >> b;
		ps[i] = Point(Float(a),Float(b));
	}
	bool oneline = true;
	auto l = linear_form(Line(ps[0],ps[1]));
	for(int i = 0;i < n;i++){
		Float a,b,c;
		tie(a,b,c) = l;
		if(a * ps[i].real() + b * ps[i].imag() != -c) oneline = false;
	}
	if(oneline){
		cout << "No" << endl;
		return 0;
	}
	map<tuple<Float,Float,Float>,vector<int>> cnt;
	for(int i = 0;i < n;i++){
		for(int j = i + 1;j < n;j++){
			auto t = linear_form(bisector(ps[i],ps[j]));
			cnt[t].push_back(i);
			cnt[t].push_back(j);
		}
	}
	for(auto p : cnt){
		//cout << p.first << " " << p.second << endl;
		if(n - p.second.size() <= 2){
			Float a,b,c;
			tie(a,b,c) = p.first;
			bool flag = true;
			set<int> st;
			for(int i = 0;i < n;i++) st.insert(i);
			for(int v : p.second) st.erase(v);
			for(int v : st){
				if(a * ps[v].real() + b * ps[v].imag() != -c) flag = false; 
			}
			if(flag){
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}
