// Etavioxy
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#define il inline
#define ll long long
#define rep(i,s,t) for(register int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(register int i=(s);i>=(t);i--)
#define each(i,u) for(int i=head[u];i;i=bow[i].nxt)
#define file(s) freopen(s".in" ,"r",stdin),freopen(s".out","w",stdout)
#define pt(x) putchar(x)
using namespace std;
il int ci(){
	register char ch;int f=1;
	while(!isdigit(ch=getchar()))f=ch=='-'?-1:1;
	register int x=ch^'0';
	while(isdigit(ch=getchar()))x=(x*10)+(ch^'0');
	return f*x;
}

#define double unsigned ll

enum{N=104};

struct P{
	double x,y;
	bool operator==(const P&e)const{ return x==e.x&&y==e.y; }
	bool operator<(const P&e)const{ if( x!=e.x ) return x<e.x; return y<e.y; }
};
il P operator+(const P&a,const P&b){ return (P){a.x+b.x,a.y+b.y}; }
il P operator-(const P&a,const P&b){ return (P){a.x-b.x,a.y-b.y}; }
il P operator*(const P&a,const double b){ return (P){a.x*b,a.y*b}; }
il double dot(const P&a,const P&b){ return a.x*b.x+a.y*b.y; }
il double cross(const P&a,const P&b){ return a.x*b.y-a.y*b.x; }
il double dist(const P&a,const P&b){ return sqrt(dot(a-b,a-b)); }

P d0[N],d1[N];

int main(){
	int n = ci();
	if( n==1 ){ cout<<"Yes"<<endl; return 0; }
	rep(i,1,n) d0[i] = (P){(double)((ll)ci()),(double)((ll)ci())};
	rep(i,1,n) d1[i] = (P){(double)((ll)ci()),(double)((ll)ci())};
	P a0 = d0[2]-d0[1];
	P a1 = (P){a0.y,-a0.x};
	double x1 = 0, x2 = 0, x3 = 0;
	rep(i,1,n){
		double x = dot(d0[i]-d0[1],a0)*(double)(1e9+7)+dot(d0[i]-d0[1],a1);
		x1 += x;
		x2 += x*x*x*x;
		x3 += x*x*x;
	}
//	printf("x123 %llu %llu %llu\n",x1,x2,x3);
	rep(i,1,n){
		rep(j,1,n) if( i!=j ){
			a0 = d1[j]-d1[i];
			a1 = (P){a0.y,-a0.x};
			double y1 = 0, y2 = 0, y3 = 0;
			rep(k,1,n){
				double x = dot(d1[k]-d1[i],a0)*(double)(1e9+7)+dot(d1[k]-d1[i],a1);
				y1 += x;
				y2 += x*x*x*x;
				y3 += x*x*x;
			}
//			printf("%d %d : \n",i,j);
//			printf("y123 %llu %llu %llu\n",y1,y2,y3);
			if( x1==y1 && x2==y2 && x3==y3 ){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 0.0000001;
struct point{
  double x, y;
  point(){
  }
  point(double x, double y): x(x), y(y){
  }
  point operator +(point P){
    return point(x + P.x, y + P.y);
  }
  point operator -(point P){
    return point(x - P.x, y - P.y);
  }
  point operator /(double k){
    return point(x / k, y / k);
  }
};
double abs(point P){
  return sqrt(P.x * P.x + P.y * P.y);
}
double dist(point P, point Q){
  return abs(Q - P);
}
double arg(point P){
  return atan2(P.y, P.x);
}
point rotate(point P, double t){
  return point(P.x * cos(t) - P.y * sin(t), P.x * sin(t) + P.y * cos(t));
}
int main(){
  int N;
  cin >> N;
  vector<point> P(N);
  for (int i = 0; i < N; i++){
    cin >> P[i].x >> P[i].y;
  }
  vector<point> Q(N);
  for (int i = 0; i < N; i++){
    cin >> Q[i].x >> Q[i].y;
  }
  point GP(0, 0), GQ(0, 0);
  for (int i = 0; i < N; i++){
    GP = GP + P[i];
    GQ = GQ + Q[i];
  }
  GP = GP / N;
  GQ = GQ / N;
  for (int i = 0; i < N; i++){
    P[i] = P[i] - GP;
    Q[i] = Q[i] - GQ;
  }
  int cntp = 0, cntq = 0;
  for (int i = 0; i < N; i++){
    if (abs(P[i]) < EPS){
      cntp++;
    }
    if (abs(Q[i]) < EPS){
      cntq++;
    }
  }
  if (cntp != cntq){
    cout << "No" << endl;
    return 0;
  }
  vector<point> P2, Q2;
  for (int i = 0; i < N; i++){
    if (abs(P[i]) > EPS){
      P2.push_back(P[i]);
    }
    if (abs(Q[i]) > EPS){
      Q2.push_back(Q[i]);
    }
  }
  N = P2.size();
  P = P2;
  Q = Q2;
  if (N == 0){
    cout << "Yes" << endl;
    return 0;
  }
  bool ok = false;
  for (int i = 0; i < N; i++){
    if (abs(abs(P[0]) - abs(Q[i])) < EPS){
      double ad = arg(Q[i]) - arg(P[0]);
      bool ok2 = true;
      for (int j = 0; j < N; j++){
        point P2 = rotate(P[j], ad);
        bool ok3 = false;
        for (int k = 0; k < N; k++){
          if (dist(P2, Q[k]) < EPS){
            ok3 = true;
          }
        }
        if (!ok3){
          ok2 = false;
        }
      }
      if (ok2){
        ok = true;
      }
    }
  }
  if (ok){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}