#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using pii = pair<int, int>;
#define rep(i, s, n) for (int i = (int)s; i < (int)n; i++)
#define repr(i, n, s) for (int i = (int)n; (int)s < i; i--)
#define len(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define debug(var) if(DEBUG) do{cout << #var << " : "; print(var);}while(0)
template<typename T> void print(T e){cout << e << '\n';}
template<typename T> void print(const vector<T>& v){string s=""; for(auto& e : v){s+=to_string(e)+' ';} s.pop_back(); cout << s << '\n';}
template<typename T> void print(const vector<vector<T>>& vv){cout << '\n'; for(auto& v : vv){print(v);}}
template<typename T> void print(const set<T>& v){string s=""; for(auto& e : v){s+=to_string(e)+' ';} s.pop_back(); cout << s << '\n';}
template<typename T> void print(const list<T>& v){string s=""; for(auto& e : v){s+=to_string(e)+' ';} s.pop_back(); cout << s << '\n';}
template<typename T> inline bool chmin(T &a, T b) {if(a>b) {a=b; return true;} return false;}
template<typename T> inline bool chmax(T &a, T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> T mod(T a, T m) {return (a % m + m) % m;}

const int INF32 = INT_MAX / 2;
const long long INF64 = LONG_LONG_MAX / 2;
const long long MOD = 1000000007;
const double PI = acos(-1);
const bool DEBUG = false;

int main() {
    int N;
    cin >> N;
    if (N == 1) {
        print("Yes");
        return 0;
    }
    vector<pair<int, int>> S, T;
    int x1c=0, y1c=0, x2c = 0, y2c = 0;
    rep(i, 0, N) {
        double a, b;
        cin >> a >> b;
        S.push_back(make_pair(a * N, b * N));
        x1c += a;
        y1c += b;
    }
    rep(i, 0, N) {
        double c, d;
        cin >> c >> d;
        T.push_back(make_pair(c * N, d * N));
        x2c += c;
        y2c += d;
    }
    // 重心を原点に移動
    rep(i, 0, N) {
        S[i] = make_pair(S[i].first - x1c, S[i].second - y1c);
        T[i] = make_pair(T[i].first - x2c, T[i].second - y2c);
    }
    // Sの基準vectorを決める。(0, 0以外)
    int ibase;
    rep(i, 0, N) {
        if (abs(S[i].first) + abs(S[i].second) >= 1) {
            ibase = i;
            break;
        }
    }
    // Sの基準との距離、クロス積、内積のtupleを計算。並び替え。
    vector<tuple<int, int, int>> S2;
    rep(i, 0, N) {
        if (i == ibase) continue;
        int x, y, x0, y0, dist, cp, ip;
        tie(x0, y0) = S[ibase];
        tie(x, y) = S[i];
        dist = (int)(pow(x - x0, 2) + pow(y - y0, 2));
        cp = x0 * y - y0 * x;
        ip = x0 * x + y0 * y;
        S2.emplace_back(dist, cp, ip);
    }
    sort(all(S2));
    // Tの各々の基準vectorについて
    bool ans = false;
    rep(i, 0, N) {
        bool ok = true;
        // 　距離、クロス積、内積のtupleを計算
        vector<tuple<int, int, int>> T2;
        rep(j, 0, N) {
            if (j == i) continue;
            int x, y, x0, y0,  dist, cp, ip;
            tie(x0, y0) = T[i];
            tie(x, y) = T[j];
            dist = (int)(pow(x - x0, 2) + pow(y - y0, 2));
            cp = x0 * y - y0 * x;
            ip = x0 * x + y0 * y;
            T2.emplace_back(dist, cp, ip);
        }
        sort(all(T2));
        //　set同士で比較。全部ほぼ一致ならTrue, break
        int eps = 0.1;
        rep(i, 0, N - 1) {
            int dist1, cp1, ip1, dist2, cp2, ip2;
            tie(dist1, cp1, ip1) = S2[i];
            tie(dist2, cp2, ip2) = T2[i];
            if (abs(dist2 - dist1) > eps || abs(cp2 - cp1) > eps || abs(ip2 - ip1) > eps) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ans = true;
            break;
        }
    }

    if (ans) {
        print("Yes");
    }
    else {
        print("No");
    }
}
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int N;
vector<ll> X1;
vector<ll> Y1;
vector<ll> X2;
vector<ll> Y2;

ll d(ll x1, ll y1, ll x2, ll y2){
  ll dx = x1 - x2;
  ll dy = y1 - y2;
  return dx * dx + dy * dy;
}
ll c(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
  ll dx = x1 - x2;
  ll dy = y1 - y2;
  ll dx2 = x1 - x3;
  ll dy2 = y1 - y3;
  return dx * dy2 - dx2 * dy;
}

vector<pair<ll,pair<ll,ll>>> f(vector<ll>& X, vector<ll>& Y){
  vector<pair<ll,pair<ll,ll>>> res;
  int n = X.size()-2;
  rep(i,n){
    ll z1 = d(X[i],Y[i],X[n],Y[n]);
    ll z2 = d(X[i],Y[i],X[n+1],Y[n+1]);
    ll z3 = c(X[i],Y[i],X[n],Y[n],X[n+1],Y[n+1]);
    res.push_back({z1,{z2,z3}});
  }
  sort(res.begin(),res.end());
  return move(res);
}

int main(){
  cin >> N;
  X1.resize(N);
  Y1.resize(N);
  rep(i,N) cin >> X1[i] >> Y1[i];
  X2.resize(N);
  Y2.resize(N);
  rep(i,N) cin >> X2[i] >> Y2[i];

  if(N == 1){ cout << "Yes\n"; return 0; }

  rep(i,N) rep(j,i) rep(t,2){
    if(d(X2[i],Y2[i],X2[j],Y2[j]) != d(X1[N-2],Y1[N-2],X1[N-1],Y1[N-1])) continue;
    swap(X2[i],X2[N-1]);
    swap(Y2[i],Y2[N-1]);
    swap(X2[j],X2[N-2]);
    swap(Y2[j],Y2[N-2]);
    if(f(X1,Y1) == f(X2,Y2)){ cout << "Yes\n"; return 0; }
    swap(X2[j],X2[N-2]);
    swap(Y2[j],Y2[N-2]);
    swap(X2[i],X2[N-1]);
    swap(Y2[i],Y2[N-1]);
    swap(X2[i],X2[j]);
    swap(Y2[i],Y2[j]);
  }

  cout << "No\n";

  return 0;
}

struct ios_do_not_sync{
  ios_do_not_sync(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} ios_do_not_sync_inst;
