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>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef complex<double> pt;
typedef pair<pt,pt> L;
typedef vector<P> poly;
const double EPS = 1e-9;
#define x real()
#define y imag()
int n;
double dot(pt a,pt b){
	return (conj(a)*b).x;
}
double cross(pt a,pt b){
	return (conj(a)*b).y;
}
pt project(pt po,pair<pt,pt> L){
	pt base = L.sc-L.fi;
	if(abs(base) <= EPS) return L.fi;
	double r = dot(po-L.fi,base) / norm(base);
	return L.fi+base*r;
}
pt reflect(pt po,pair<pt,pt> L){
    if(abs(L.fi-L.sc) <= EPS) return 2.0*L.fi-po;
	return po + (project(po,L)-po)*2.0;
}
bool eq(double a,double b){
  return (-EPS < a-b && a-b < EPS);
}
int ccw(pt a,pt b,pt c){
	b -= a; c -= a;
	if(cross(b,c) > EPS) return 1; // counter clockwise
	if(cross(b,c) < -EPS) return -1; // clockwise
	if(dot(b,c) < -EPS) return 2; //c-a-b
	if(norm(b) < norm(c)) return -2; //a-b-c
	return 0; //a-c-b
}
set<P>S;
vector<pt>p;
int main(){
	cin >> n ; 
	rep(i,n){
		double X,Y;
		scanf("%lf%lf",&X,&Y);
		int x2 = floor(X+EPS),y2 = floor(Y+EPS);
		if(S.find(mp(x2,y2)) != S.end()) continue;
		S.insert(mp(x2,y2));
		p.pb(pt(X,Y));
	}
	n = p.size();
	for(int i=2;i<n;i++) if(ccw(p[0],p[1],p[i])%2 != 0) goto ok;
	puts("No"); return 0; ok:;
	for(int i=1;i<n;i++){
		//0 and i
		for(int j=1;j<n;j++){
			if(i==j) continue;
			pt R = reflect(p[j],mp(p[0],p[i]));
			int X = floor(R.x),Y = floor(R.y);
			bool ok = 0;
			for(int xx=X-1;xx<=X+1;xx++){
				for(int yy=Y-1;yy<=Y+1;yy++){
					double X2 = (double)xx,Y2 = (double)yy;
					if(abs(R-pt(X2,Y2)) <= EPS){
						if(S.find(mp(xx,yy)) == S.end() || abs(p[j]-pt(X2,Y2))<=EPS) goto bad;
						ok = 1;
					}
				}
			}
			if(!ok) goto bad;
		}
		puts("Yes"); return 0; bad:;
	}
	for(int i=2;i<n;i++){
		//pass 0 and tangent to 1 and i
		pt B = p[0]+(p[1]-p[i])*pt(0.0,1.0);
		int cnt = 0;
		for(int j=1;j<n;j++){
			pt R = reflect(p[j],mp(p[0],B));
			int X = floor(R.x),Y = floor(R.y);
			bool ok = 0;
			for(int xx=X-1;xx<=X+1;xx++){
				for(int yy=Y-1;yy<=Y+1;yy++){
					double X2 = (double)xx,Y2 = (double)yy;
					if(abs(R-pt(X2,Y2)) <= EPS){
						if(S.find(mp(xx,yy)) == S.end()) goto bad2;
						if(abs(p[j]-pt(X2,Y2))<=EPS) cnt++;
						if(cnt>=2) goto bad2;
						ok = 1;
					}
				}
			}
			if(!ok) goto bad2;
		}
		puts("Yes"); return 0; bad2:;
	}
	for(int i=1;i<n;i++){
		//0 and i (midpoint)
		pt RR = (p[0]+p[i])/2.0;
		pt SS = RR+(p[0]-p[i])*pt(0.0,1.0);
		int cnt = 0;
		for(int j=1;j<n;j++){
			if(i==j) continue;
			pt R = reflect(p[j],mp(RR,SS));
			int X = floor(R.x),Y = floor(R.y);
			bool ok = 0;
			for(int xx=X-1;xx<=X+1;xx++){
				for(int yy=Y-1;yy<=Y+1;yy++){
					double X2 = (double)xx,Y2 = (double)yy;
					if(abs(R-pt(X2,Y2)) <= EPS){
						if(S.find(mp(xx,yy)) == S.end()) goto bad3;
						if(abs(p[j]-pt(X2,Y2))<=EPS) cnt++;
						if(cnt>=3) goto bad3;
						ok = 1;
					}
				}
			}
			if(!ok) goto bad3;
		}
		puts("Yes"); return 0; bad3:;
	}
	puts("No");
}