// 問題の URL を書いておく
// 

#include <bits/stdc++.h>

using namespace std;

//#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#define P(fmt, ...) printf(fmt, __VA_ARGS__)
#define LP printf("L: %d\n", __LINE__)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)
#define P(fmt, ...) ((void)0)
#define LP ((void)0)

#endif

#define rep(i, n) for(int i = 0; i < (int)(n); ++i)

using ll = long long;

const double PI = acos(-1);
using P = pair<int, int>;

int calcDist(const P& a, const P& b)
{
    return (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
}

int calcMul(const P& a, const P& b)
{
    return a.first * b.second - b.first * a.second;
}

pair<P, int> calcDistAndMul(const P& a, const P& b, const P& c)
{
    P dm;
    dm.first = calcDist(a, c);
    dm.second = calcDist(b, c);
    P v0 = {c.first - a.first, c.second - a.second};
    P v1 = {c.first - b.first, c.second - b.second};

    auto mul = calcMul(v0, v1);    
    return {dm, mul};
}

int main(int, const char**)
{
    int N;
    cin >> N;
    vector<P> S(N), 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(calcDist(S[0], S[1]) == calcDist(T[0], T[1]))
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
        return 0;
    }

    vector<pair<P, int>> md(N - 2);
    rep(i, N - 2)
    {
        auto ti = i + 2;
        md[i] = calcDistAndMul(T[0], T[1], T[ti]);
    }

    sort(md.begin(), md.end());
#if 1
    rep(i, N - 2)
    {
        P("[%d]: (%d, %d, %d)\n", i, md[i].first.first, md[i].first.second, md[i].second);
    }
#endif

    rep(i, N) rep(j, N)
    {
        if(i == j) continue;
        P("i, j = (%d, %d)-----------------\n", i, j);
        vector<pair<P, int>> d(N - 2);
        int dcount = 0;
        rep(k, N)
        {
            if(k == i || k == j) continue;
            d[dcount++] = calcDistAndMul(S[i], S[j], S[k]);
        }
        sort(d.begin(), d.end());

#if 1
        rep(k, dcount)
        {
            P("[%d]: (%d, %d, %d)\n", k, d[k].first.first, d[k].first.second, d[k].second);
        }
#endif
        bool valid = true;
        rep(k, dcount)
        {
            if(md[k] != d[k])
            {
                valid = false;
                break;
            }
        }
        if(valid)
        {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}

#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define reps(i,s,n) for (int i = (int)(s); i < (int)(n); i++)
#define prl(a) cout << (a) << endl
#define allrange(a) a.begin(),a.end()

bool solve_translated(vector<pair<int,int>> &S,vector<pair<int,int>> &T){
    int N = S.size();
    int dx = S[0].first-T[0].first;
    int dy = S[0].second-T[0].second;
    bool flg = true;
    reps(i,1,min(N,20)){
        if(!((S[i].first==T[i].first+dx) && (S[i].second==T[i].second+dy))){flg = false; break;} 
    }
    return flg;
}
vector<pair<int,int>> Pitagora_rot(vector<pair<int,int>> &S,int a, int b , int c){
    int N = S.size();
    vector<pair<int,int>> PS(N);
    auto pt0 = S[0];
    PS[0] = pt0;
    bool flg = true;
    int dx,dy,x,y;
    reps(i,1,N){
        dx = S[i].first - pt0.first;
        dy = S[i].second - pt0.second;
        x=dx*a-dy*b;
        y=dx*b+dy*a;
        if(((x%c)!=0) || ((y%c)!=0)) {flg = false; break;}
        PS[i] = make_pair(x/c+pt0.first, y/c+pt0.second);
    }
    if(flg) return PS;
    else return vector<pair<int,int>>();
}


int main(){
    std::cin.tie(0); 
    std::ios::sync_with_stdio(false);
    int N;cin >> N;

    vector<pair<int,int>> S(N),T(N);
    rep(i,N)
    {
        int x,y;
        cin >> x >> y;
        S[i].first = x;S[i].second = y;
    }

    rep(i,N)
    {
        int x,y;
        cin >> x >> y;
        T[i].first = x;
        T[i].second = y;
    }
    sort(allrange(T));
  
/*ピタゴラ三角形
    5	12	13
    8	15	17
    3	4	5
*/
    constexpr int tri[12][3] ={ 
    {3,4,5},
    {4,3,5},
    {-3,4,5},
    {-4,3,5},
    {0,1,1},
    {1,0,1},
    {-1,0,1},
    {0,-1,1},
    {-3,-4,5},
    {-4,-3,5},
    {3,-4,5},
    {4,-3,5}
    };

 /*
    vector<vector<int>> tri(0);
    tri.push_back(vector<int>({3,4,5}));
    tri.push_back(vector<int>({4,3,5}));
    tri.push_back(vector<int>({-3,4,5}));
    tri.push_back(vector<int>({-4,3,5}));
    tri.push_back(vector<int>({0,1,1}));
    tri.push_back(vector<int>({1,0,1}));
    tri.push_back(vector<int>({-1,0,1}));
    tri.push_back(vector<int>({0,-1,1}));
    tri.push_back(vector<int>({-3,-4,5}));
    tri.push_back(vector<int>({-4,-3,5}));
    tri.push_back(vector<int>({3,-4,5}));
    tri.push_back(vector<int>({4,-3,5}));
 //   tri.push_back(vector<int>({-5, -12, 13}));
 //   tri.push_back(vector<int>({-12, -5, 13}));
 //   tri.push_back(vector<int>({-8,-15,17}));
 //   tri.push_back(vector<int>({-15,-8,17}));
 //   tri.push_back(vector<int>({5, 12, 13}));
 //   tri.push_back(vector<int>({12, 5, 13}));
 //   tri.push_back(vector<int>({8,15,17}));
 //   tri.push_back(vector<int>({15,8,17}));
 //   tri.push_back(vector<int>({-5, 12, 13}));
 //  tri.push_back(vector<int>({-12, 5, 13}));
  //  tri.push_back(vector<int>({-8,15,17}));
  //  tri.push_back(vector<int>({-15,8,17}));
 //   tri.push_back(vector<int>({5, -12, 13}));
 //   tri.push_back(vector<int>({12, -5, 13}));
 //   tri.push_back(vector<int>({8,-15,17}));
 //   tri.push_back(vector<int>({15,-8,17}));

 */
    bool flg;

    if(N==2){
        auto sx = S[0].first-S[1].first;
        auto sy = S[0].second-S[1].second;
        auto tx = T[0].first-T[1].first;
        auto ty = T[0].second-T[1].second;
        flg= (sx*sx+sy*sy==tx*tx+ty*ty);
    } else {
        rep(j,12){    
            auto S2 = Pitagora_rot(S,tri[j][0],tri[j][1],tri[j][2]);
            if(S2.empty()) continue;
            sort(allrange(S2));
            flg = solve_translated(S2,T);
            if(flg) break;
        }
    }
    if(flg) prl("Yes"); else prl("No");
}
