#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include <atcoder/all>
using namespace std;
//using namespace boost::multiprecision;
//using namespace atcoder;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define bra(firstsecond) '(' << first< ',' << second< ')'
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 1001001001001001001;
long double EPS = 1e-8;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index)
{
   vector.erase(vector.begin() + index);
}


random_device seed_gen;
mt19937_64 rnd(seed_gen());
 
ll range_rand(ll a,ll b){
    uniform_int_distribution<ll> dist_res(a,b);
    return dist_res(rnd);
}
 

using Graph = vector<vector<tuple<ll,ll,ll>>>;


// MOD確認

ll N;
ll x[110],y[110],x2[110],y2[110];
double X[110],Y[110];
ll D[60][60],D1[60][60];

int main(){
    cin >> N;
    rep(i,N) cin >> x[i] >> y[i];
    rep(i,N) cin >> x2[i] >> y2[i];
    ll a = x[0],b = y[0];
    rep(i,N){
        x[i] -= a;
        y[i] -= b;
        D[x[i] + 30][y[i] + 30]++;
    }

    rep(i,N){
        ll dx = x[0] - x2[i],dy = y[0] - y2[i];
        ll M = 0;
        rep(j,N){
            x2[j] += dx;
            y2[j] += dy;
            M = max({M,abs(x2[j]),abs(y2[j])});
        }
        FOR(j,-M,M+1) FOR(k,-M,M+1){
            long double theta = atan2(j,k);
            bool flag = 1;
            rep(l,60) rep(m,60) D1[l][m] = 0; 
            rep(l,N){
                X[l] = x2[l] * cos(theta) - y2[l] * sin(theta);
                Y[l] = x2[l] * sin(theta) + y2[l] * cos(theta);
                if(abs(X[l] - round(X[l])) > 0.2 || abs(Y[l] - round(Y[l])) > 0.2) flag = 0;
                D1[(ll)round(X[l]) + 30][(ll)round(Y[l]) + 30]++;
            }
            rep(l,60) rep(m,60) if(D[l][m] != D1[l][m]) flag = 0; 
            if(flag){
                cout << "Yes" << endl;
                //cout << theta / PI * 180 << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}



#include <iostream>
#include <vector>
#include  <set>
#include <math.h>
#include <algorithm>
#define MAXA 1000000
#define ll long long
using namespace std;
 
int GetNorm(int x,int y) {
    return x*x+y*y;
}
int A[111];
int B[111];
int C[111];
int D[111];
 
bool Check(int N) {
    if (N == 1) return true;
    vector<pair<ll,ll> > right_pts;
    for(int i=1;i<=N;i++) {
        right_pts.push_back({C[i],D[i]});
    }
    sort(right_pts.begin(),right_pts.end());
    int xans, yans, denomans;
    denomans=-1;
    for(int i=1;i<=N;i++) {
        for(int j=1;j<=N;j++) {
            if (i == j) continue;
            ll dA = A[1]-A[2];
            ll dB = B[1]-B[2];
            ll dC = C[i]-C[j];
            ll dD = D[i]-D[j];
            // A[i]-A[j], B[j]-B[j]
            if (GetNorm(dA, dB) != GetNorm(dC, dD)) {
                continue;
            }
            ll x = dC*dA+dD*dB;
            ll y = dA*dD-dC*dB;
            ll denom = GetNorm(dA, dB);
            // x/denom+j*y/denom 
            // (A[1]+j*B[1])*(x+j*y) + delta = C[i]+j*D[i]
 
            ll delta_1 = C[i]*denom-(A[1]*x-y*B[1]);
            ll delta_2 = D[i]*denom-(A[1]*y+x*B[1]);
 
            vector<pair<ll,ll> > pts;
            bool ok=true;
            for(int k=1;k<=N;k++) {
                // (A[i]+j*B[i])*(x+j*y) + delta
                ll X = A[k]*x-B[k]*y+delta_1;
                ll Y = A[k]*y+B[k]*x+delta_2;
                if (X%denom != 0 || Y%denom != 0) ok=false;
                pts.push_back({X/denom,Y/denom});
            }
            if (!ok) continue;
 
            sort(pts.begin(),pts.end());
            
 
 
            if (pts==right_pts) return true;
        }
    }
    return false;
 
    
 
}
 
int main() {
    int N;
    cin>>N;
    for(int i=1;i<=N;i++) {
        cin>>A[i]>>B[i];
    }
    for(int i=1;i<=N;i++) {
        cin>>C[i]>>D[i];
    }
    if (Check(N)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
 
}