#include<bits/stdc++.h>
#define rep(i, N) for(i = 0; i < N; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define printYN(ans) ans ? cout << "Yes\n" : cout << "No\n" 
#define printyn(ans) ans ? cout << "yes\n" : cout << "no\n"
#define clnt(a, b) ((a + b - 1) / b)
#define same(f1, f2) (abs(f1 - f2) <= EPS)
#define pow2(n) (n * n)
using namespace std;
using ll = int64_t;
const double EPS = 1e-8;
const int MAX_N = 1<<17;
const int MOD = 1e9+7;
const int INF = 1e9+10;
const int NIL = -1;

int main(){
    long double SX[101], SY[101], TX[101], TY[101];
    long double sumSX = 0, sumSY = 0, sumTX = 0, sumTY = 0;
    int N, i, j, k; cin >> N;

    rep(i, N){
        cin >> SX[i] >> SY[i];
        sumSX += SX[i], sumSY += SY[i];
    }
    rep(i, N){
        cin >> TX[i] >> TY[i];
        sumTX += TX[i], sumTY += TY[i];
    }
    sumSX /= N, sumSY /= N, sumTX /= N, sumTY /= N;

    int S0idx = -1, T0idx = -1;
    rep(i, N){
        SX[i] -= sumSX, SY[i] -= sumSY;
        TX[i] -= sumTX, TY[i] -= sumTY;
        if(same(SX[i], 0) && same(SY[i], 0)) S0idx = i;
        if(same(TX[i], 0) && same(TY[i], 0)) T0idx = i;
    }

    bool fnd = true, ans = true;
    int fidx = 0;

    if((S0idx == -1) != (T0idx == -1)) ans = false;
    else if(N == 1) ans = true;
    else{
        if(S0idx == 0) fidx = 1;
        long double sinS, cosS, sinT, cosT, RS, RT;

        RS = sqrt(pow2(SX[fidx]) + pow2(SY[fidx]));
        sinS = SY[fidx] / RS, cosS = SX[fidx] / RS;

        rep(i, N){
            if(i == T0idx) continue;
            ans = true;

            RT = sqrt(pow2(TX[i]) + pow2(TY[i]));
            sinT = TY[i] / RT, cosT = TX[i] / RT;

            rep(j, N){         
                fnd = false;

                long double mvSX, mvSY;
                mvSX = cosT * SX[j] - sinT * SY[j], mvSY = cosT * SY[j] + sinT * SX[j];

                rep(k, N){
                    long double mvTX, mvTY;
                    mvTX = cosS * TX[k] - sinS * TY[k], mvTY = cosS * TY[k] + sinS * TX[k];
                    if(same(mvSX, mvTX) && same(mvSY, mvTY)) fnd = true;
                }

                if(fnd == false){
                    ans = false;
                    break;
                }
            }

            if(ans) break;
        }
    }

    printYN(ans);
    return 0;
}
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<pair<int,int>> A, B;
  for(int i = 0; i < n; ++i){
    int x, y;
    cin >> x >> y;
    x *= n, y *= n;
    A.emplace_back(x,y);
  }
  for(int i = 0; i < n; ++i){
    int x, y;
    cin >> x >> y;
    x *= n, y *= n;
    B.emplace_back(x,y);
  }

  auto convert = [](vector<pair<int,int>> A, int idx){
    const int n = A.size();
    vector<pair<int,int>> R;
    int gx = 0, gy = 0;

    for(auto [x,y] : A){
      gx += x/n, gy += y/n;
    }

    auto [xi,yi] = A[idx];
    xi -= gx, yi -= gy;
    
    for(auto [x,y] : A){
      x -= gx, y -= gy;
      R.emplace_back(x*xi+y*yi, x*yi-y*xi);
    }
    return R;
  };

  for(int i = 0; i < n; ++i){
    for(int j = 0; j < n; ++j){
      auto a = convert(A,i), b = convert(B,j);
      sort(a.begin(),a.end());
      sort(b.begin(),b.end());
      if(a == b){
        puts("Yes");
        return 0;
      }
    }
  }

  puts("No");
}
