#include <iostream>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <cmath>

std::array<int, 2> cog(const  std::vector < std::array<int, 2>>& ps)
{
  std::array<int, 2> result = { 0,0 };
  for (auto& e : ps)
  {
    result[0] += e[0];
    result[1] += e[1];
  }

  result[0] /= (int)ps.size();
  result[1] /= (int)ps.size();
  return result;
}

void counter_tranlate_all(std::vector<std::array<int,2>>& ps, const std::array<int,2>& m)
{
  for (auto& e : ps)
  {
    e[0] -= m[0];
    e[1] -= m[1];
  }
}

bool test_rot(
  std::map<int, std::set<double>> ss_polar,
  std::map<int, std::set<double>> ts_polar,
  double rot)
{
  for (auto&& d : ts_polar)
  {
    auto x = ss_polar[d.first];
    auto y = ts_polar[d.first];
    if (x.size() != y.size()) { return false; }

    if(d.first == 0 )
    {
      continue;
    }

    std::set<double> mov_y;
    for (auto e : y)
    {
      mov_y.insert(e + rot);
    }

    for (auto& y : mov_y)
    {
      bool ok = false;
      for (auto& e : x)
      {
        if (std::remainder(y - e, 360.) < 1e-6)
        {
          ok = true;
          break;
        }
      }
      if (!ok) { return false; }
    }
  }

  return true;
}


int main()
{
  int N;
  std::cin >> N;
  std::vector<std::array<int, 2>> ss(N);
  for (auto& e : ss)
  {
    std::cin >> e[0] >> e[1];
    e[0] *= N;
    e[1] *= N;
  }
  std::vector<std::array<int, 2>> ts(N);
  for (auto& e : ts)
  {
    std::cin >> e[0] >> e[1];
    e[0] *= N;
    e[1] *= N;
  }

  auto cog_ss = cog(ss);
  auto cog_ts = cog(ts);

  counter_tranlate_all(ss, cog_ss);
  counter_tranlate_all(ts, cog_ts);

  int dist2_ss = 0;
  for (auto& e : ss)
  {
    int d = e[0] * e[0] + e[1] * e[1];
    if (dist2_ss < d) { dist2_ss = d; }
  }

  int dist2_ts = 0;
  for (auto& e : ts)
  {
    int d = e[0] * e[0] + e[1] * e[1];
    if (dist2_ts < d) { dist2_ts = d; }
  }

  if (dist2_ss != dist2_ts)
  {
    std::cout << "No" << std::endl;
    return 0;
  }

  double PI = 3.14159265359;

  std::map<int, std::set<double>> ss_polar;
  for (auto& e : ss)
  {
    int d = e[0] * e[0] + e[1] * e[1];
    ss_polar[d].insert(std::atan2(e[1],e[0])*180 /PI);
  }

  std::map<int, std::set<double>> ts_polar;
  for (auto& e : ts)
  {
    int d = e[0] * e[0] + e[1] * e[1];
    ts_polar[d].insert(std::atan2(e[1], e[0]) * 180 / PI);
  }

  std::set<double> moves;
  {
    double b = *ss_polar[dist2_ss].begin();
    for (auto& t : ts_polar[dist2_ss])
    {
      moves.insert(b - t);
    }
  }
  
  for (auto& e : moves)
  {
    auto ret = test_rot(ss_polar, ts_polar, e);
    if (ret)
    {
      std::cout << "Yes" << std::endl;
      return 0;
    }
  }

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

//#include <atcoder/all>
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<pair<ll, ll>>>;
vector<ll> fact, factinv, inv;
ll mod = 1e9 + 7;

int main() {
    ll N;
    cin >> N;

    vector<pair<ll, ll>> S(N), T(N);
    vll La(N), Ra(N);
    set<pair<ll, ll>> TP;
    rep(i, N) {
        ll L, R;
        cin >> L >> R;
        S[i] = make_pair(L, R);
    }
    rep(i, N) {
        ll L, R;
        cin >> L >> R;
        T[i] = make_pair(L, R);
        TP.insert(T[i]);
    }

    if (N == 1) {
        cout << "Yes" << endl;
        return 0;
    }
    if (N == 2) {
        if ((S[0].first - S[1].first) * (S[0].first - S[1].first) + (S[0].second - S[1].second) * (S[0].second - S[1].second) == (T[0].first - T[1].first)
            * (T[0].first - T[1].first) + (T[0].second - T[1].second) * (T[0].second - T[1].second)) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }

        return 0;
    }
    rep(i, N) {
        //S[0]→T[i]
        rep(j, N) {
            //S[1]→T[j]
            if (i == j)continue;
            if ((S[0].first - S[1].first) * (S[0].first - S[1].first) + (S[0].second - S[1].second) * (S[0].second - S[1].second) != (T[i].first - T[j].first)
                * (T[i].first - T[j].first) + (T[i].second - T[j].second) * (T[i].second - T[j].second)) {
                continue;
            }
            ll r = (S[0].first - S[1].first) * (S[0].first - S[1].first) + (S[0].second - S[1].second) * (S[0].second - S[1].second);
            bool c = true;
            for (ll k = 2; k < N; k++) {
                ll dx1 = -S[0].first + S[1].first;
                ll dy1 = -S[0].second + S[1].second;
                ll dx = -S[0].first + S[k].first;
                ll dy = -S[0].second + S[k].second;

                ll dx2 = -T[i].first + T[j].first;
                ll dy2 = -T[i].second + T[j].second;

                ll tx = (dx * dx1 + dy1 * dy) * dx2 - (-dx * dy1 + dy * dx1) * dy2;
                ll ty = (dx * dx1 + dy1 * dy) * dy2 + (-dx * dy1 + dy * dx1) * dx2;
                tx /= r;
                ty /= r;
                if (!TP.count(make_pair(tx+ T[i].first, ty+ T[i].second))) {
                    c = false;
                }

            }
            if (c) {
                cout << "Yes" << endl;
                return 0;
            }

        }
    }
    cout << "No" << endl;
}