#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using std::cout;
using std::cin;
using std::endl;
using ll=long long;
using ld=long double;
ll I=1167167167167167167;
ll Q=1e9+7;
#define rep(i,a) for (ll i=0;i<a;i++)
template<class T> using _pq = priority_queue<T, vector<T>, greater<T>>;
template<class T> ll LB(vector<T> &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> ll UB(vector<T> &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}else return 0;}
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}else return 0;}
template<class T> void So(vector<T> &v) {sort(v.begin(),v.end());}
template<class T> void Sore(vector<T> &v) {sort(v.begin(),v.end(),[](T x,T y){return x>y;});}
template<class T> void print_tate(vector<T> &v) {rep(i,v.size()) cout<<v[i]<<"\n";}
void yneos(bool a){if(a) cout<<"Yes"<<"\n"; else cout<<"No"<<"\n";}



//おちこんだりもしたけれど、私はげんきです。
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int N;
	cin>>N;
	ll cen[4];
	rep(i,4) cen[i]=0;
	vector<ll> A(N),B(N),C(N),D(N); 
	rep(i,N){
		cin>>A[i]>>B[i];
		A[i]*=N;
		B[i]*=N;
		cen[0]+=A[i];
		cen[1]+=B[i];
	}
	rep(i,N){
		cin>>C[i]>>D[i];
		C[i]*=N;
		D[i]*=N;
		cen[2]+=C[i];
		cen[3]+=D[i];
	}
	rep(i,4) cen[i]/=N;
	rep(i,N){
		A[i]-=cen[0];
		B[i]-=cen[1];
		C[i]-=cen[2];
		D[i]-=cen[3];
	}
	if(A[0]*A[0]+B[0]*B[0]==0){
		swap(A[0],A[1]);
		swap(B[0],B[1]);
	}
	set<pair<int,int>> s;
	ll L=A[0]*A[0]+B[0]*B[0];
	rep(i,N) s.insert({C[i]*L,D[i]*L});
	bool T=false;
	vector<vector<ll>> q=
	{
		{A[0],B[0]},
		{B[0]*-1,A[0]}
	};
	//rep(i,N) cout<<A[i]<<" "<<B[i]<<" "<<C[i]<<" "<<D[i]<<endl;
	rep(i,N){
		if(L!=C[i]*C[i]+D[i]*D[i]) continue;
		bool U=true;
		vector<vector<ll>> p(2,vector<ll>(2));
		vector<vector<ll>> r=
		{
			{C[i],D[i]*-1},
			{D[i],C[i]}
		};
		rep(a,2) rep(b,2) rep(c,2){
			p[a][b]+=q[a][c]*r[c][b];
		}
		/*rep(i,2){
			rep(j,2) cout<<p[i][j]<<" ";
			cout<<endl;
		}*/
		rep(j,N){
			ll X=0,Y=0;
			X=A[j]*p[0][0]+B[j]*p[0][1];
			Y=A[j]*p[1][0]+B[j]*p[1][1];
			if( !s.count({X,Y}) ){
				U=false;
				break;
			}
		}
		T|=U;
	}
	yneos(T);
}


// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

ll cross(ll x1, ll y1, ll x2, ll y2) {
    return x1*y2 - x2*y1;
}
ll dot(ll x1, ll y1, ll x2, ll y2) {
    return x1*x2 + y1*y2;
}

int main() {
    int N; cin >> N;
    vector<int> A(N), B(N);
    for(int i=0; i<N; i++) cin >> A[i] >> B[i];
    vector<int> C(N), D(N);
    for(int i=0; i<N; i++) cin >> C[i] >> D[i];

    if(N == 1) {
        puts("Yes");
        return 0;
    }
    
    set< vector< tuple<ll, ll, ll> > > S;
    for(int i=0; i<N; i++) {
        for(int j=0; j<N; j++) {
            if(i == j) continue;
            // ベクトル ij に沿って x 軸を作る感じ
            ll x1 = A[j] - A[i], y1 = B[j] - B[i];
            vector< tuple<ll, ll, ll> > vec;
            for(int k=0; k<N; k++) {
                ll x2 = A[k] - A[i], y2 = B[k] - B[i];
                ll c = cross(x1, y1, x2, y2);
                ll d = dot(x1, y1, x2, y2);
                ll len = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
                vec.emplace_back(c, d, len);
            }
            sort(vec.begin(), vec.end());
            S.emplace(vec);
        }
    }
    for(int i=0; i<N; i++) {
        for(int j=0; j<N; j++) {
            if(i == j) continue;
            ll x1 = C[j] - C[i], y1 = D[j] - D[i];
            vector< tuple<ll, ll, ll> > vec;
            for(int k=0; k<N; k++) {
                ll x2 = C[k] - C[i], y2 = D[k] - D[i];
                ll c = cross(x1, y1, x2, y2);
                ll d = dot(x1, y1, x2, y2);
                ll len = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
                vec.emplace_back(c, d, len);
            }
            sort(vec.begin(), vec.end());
            if(S.count(vec)) {
                puts("Yes");
                return 0;
            }
        }
    }
    puts("No");
    return 0;
}
