/*input
3
0 0
0 1
1 0
2 0
3 0
3 1

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long,null_type,less_equal<long long>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("O2","unroll-loops","no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
using ll=long long;
using ld=long double;
using pii=pair<ld,ld>;
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()),c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const ll INF64=1e18+1;
const int INF=0x3f3f3f3f;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld eps=1e-3;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
inline ll mult(ll a,ll b){
    if(a>=MOD) a%=MOD;
    if(b>=MOD) b%=MOD;
    return (a*b)%MOD;
}
inline ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
const int maxn=3e3+5;
const int maxlg=__lg(maxn)+2;
ll get(pii a){
    return (a.f*a.f+a.s*a.s);
}

bool cmp(pii a,pii b){
    if(atan2(a.s,a.f)==atan2(b.s,b.f)) return get(a)<get(b);
    return atan2(a.s,a.f)<atan2(b.s,b.f);
}
ld cross(pii a,pii b){
    if(sqrt((a.f*a.f+a.s*a.s)*(b.f*b.f+b.s*b.s))==0) return 1;
    return (a.f*b.f+a.s*b.s)/sqrt((a.f*a.f+a.s*a.s)*(b.f*b.f+b.s*b.s));
}
int n;
void shift(pii a[]){
    int x=0,y=0;
    REP(i,n){
        x+=a[i].f,y+=a[i].s;
        a[i].f*=n,a[i].s*=n;
    }
    REP(i,n) a[i].f-=x,a[i].s-=y;
}
pii a[maxn],b[maxn];
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);
    cin>>n;
    REP(i,n){
        cin>>a[i].f>>a[i].s;
    }
    REP(i,n) cin>>b[i].f>>b[i].s;
    shift(a),shift(b);
    REP(i,n) if(a[i].f or a[i].s){
        swap(a[i],a[0]);
        swap(b[i],b[0]);
        break;
    }
    REP(i,n){
        ld z=atan2(b[i].s,b[i].f)-atan2(a[0].s,a[0].f);
        bool wk=1;
        ld s=sin(z),cc=cos(z);
        REP(j,n){
            pii tmp;
            tmp.f=a[j].f*cc-a[j].s*s;
            tmp.s=a[j].f*s+a[j].s*cc;
            bool ok=0;
            REP(k,n){
                if(abs(tmp.f-b[k].f)<=eps and abs(tmp.s-b[k].s)<=eps) ok=1;
            }
            wk&=ok;
        }
        if(wk){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}
#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;
    }

}