#include "bits/stdc++.h"
#include <chrono>
#include <random>
#define lli long long int
using namespace std;
#define mod 1000000007
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 1000000000
#define common cout << "Case #" << w+1 << ": "  
#define maxn 2000010

void setIO(string name) {
	ios_base::sync_with_stdio(0); cin.tie(0);
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}

template< typename T> 
void PVecPrint(vector<T>&v) 
{ 
    for(int i=0;i<(int)v.size();i++) 
        cout << v[i].first << "," << v[i].second << ' '; 
    cout << '\n'; 
}
template<class T> 
void VecPrint(vector<T>&v)
{
    for(int i=0;i<v.size();i++) 
        cout << v[i] << ' ';
    cout << '\n';
}
/*-------------------------------------------------------------------Code-----------------------------------------------------------------*/

typedef complex<double> point;
#define x real()
#define y imag()

double piv= (double)3.141592653589793/(double)180;

point func(point X,int val)
{
    double theta = piv*val;
    point Xnew=(X * polar(1.0, theta));
    return Xnew;
}

bool iseq(point p1,point p2)
{
    if(abs(p1.x-p2.x)<=0.1 and abs(p1.y-p2.y)<=0.1)
        return true;
    return false;
}

bool found(point p,vector<point>&v)
{
    for(int i=0;i<v.size();i++)
    {
        if(iseq(p,v[i]))
            return true;
    }
    return false;
}

bool func(vector<point>&v1,vector<point>&v2)
{
    for(int i=0;i<v1.size();i++)
    {
        if(!found(v1[i],v2))
            return false;
    }
    return true;
}

int main()
{
    fastio;
    int n;
    cin >> n;
    vector<point>v1(n),v2(n);
    for(int i=0;i<n;i++)
    {
        int x1,y1;
        cin >> x1 >> y1;
        point t(x1,y1);
        v1[i]=t;
    }
    for(int i=0;i<n;i++)
    {
        int x1,y1;
        cin >> x1 >> y1;
        point t(x1,y1);
        v2[i]=t;
    }
    int f=0;
    for(int i=0;i<360 and f==0;i++)
    {
        vector<point>v3(n);
        for(int j=0;j<n;j++)
            v3[j]=func(v1[j],i);
        for(int k=0;k<n;k++)
        {
            // cout << i << ' ' << k << '\n';
            double dx = v2[k].x-v3[0].x,dy=v2[k].y-v3[0].y;
            for(int j=0;j<n;j++)
                v3[j]=point(v3[j].x+dx,v3[j].y+dy);
            if(func(v3,v2))
                f=1;
        }
    }
    if(f==1)
        cout << "Yes\n";
    else
        cout << "No\n";
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007 //998244353
#define PI 3.141592653
#define INF 100000000000000 //14
//cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

ll pow(P p1, P p2) {
    ll x0 = p1.first; ll y0 = p1.second;
    ll x1 = p2.first; ll y1 = p2.second;
    return (x0-x1)*(x0-x1)+(y0-y1)*(y0-y1);
}
int main(){
    ll n; cin >> n;
    vector<P> s(n);
    vector<P> t(n);
    REP(i,n) cin >> s[i].first >> s[i].second;
    REP(i,n) cin >> t[i].first >> t[i].second;
    if (n==1) {
        cout << "Yes" << endl;
        return 0;
    }
    if (n==2) {
        if (pow(s[0],s[1])==pow(t[0],t[1])) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
    }
    ll xt = t[0].first; ll yt = t[0].second;
    REP(i,n) t[i].first-=xt, t[i].second-=yt;
    // REP(i,n) cout << s[i].first << " " << s[i].second << " " << t[i].first << " " << t[i].second << endl;
    REP(i,n) REP(j,n){
        if (i==j) continue;
        ll d0 = pow(s[i],s[j]); ll d1 = pow(t[0],t[1]);
        if (d0!=d1) continue;
        vector<P> u(n);
        ll x = s[i].first; ll y = s[i].second;
        REP(k,n) u[k].first = s[k].first-x, u[k].second = s[k].second-y;
        // cout << "test2 " << i << " " << j << endl; cout << x <<  " " << y << endl;
        // cout << "u" << endl;
        // REP(k,n) cout << u[k].first << " " << u[k].second << endl;
        ll a, b, c;
        x = u[j].first; y = u[j].second;
        ll z = t[1].first; ll w = t[1].second;
        b = y*z-x*w; a = z*x+w*y; c = x*x+y*y;
        // cout << a << " " << b << " " << c << endl;
        vector<P> uu(n);
        REP(k,n) {
            uu[k].first = a*u[k].first+b*u[k].second;
            uu[k].second = a*u[k].second-b*u[k].first;
        }
        swap(u,uu);
        vector<P> v(n);
        REP(k,n) v[k].first = t[k].first*c, v[k].second = t[k].second*c;
        sort(u.begin(),u.end());
        sort(v.begin(),v.end());
        // cout << "test1 " << i << " " << j << endl;
        // cout << "u" << endl;
        // REP(k,n) cout << u[k].first << " " << u[k].second << endl;
        // cout << "v" << endl;
        // REP(k,n) cout << v[k].first << " " << v[k].second << endl;
        bool judtmp = true;
        REP(k,n) if (v[k]!=u[k]) judtmp = false;
        if (judtmp) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}