#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0, length = n; i < length; i++)
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ep emplace
#define epb emplace_back
#define scll static_cast<long long> 
#define sz(x) static_cast<int>((x).size())
#define pfll(x) printf("%lld\n", x)
#define ci(x) cin >> x
#define ci2(x, y) cin >> x >> y
#define ci3(x, y, z) cin >> x >> y >> z
#define ci4(w, x, y, z) cin >> w >> x >> y >> z
#define co(x) cout << x << endl
#define co2(x, y) cout << x << " " << y << endl
#define co3(x, y, z) cout << x << " " << y << " " << z << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> PQ;
typedef priority_queue<int, vector<int>, greater<int>> PQG;
typedef priority_queue<P> PQP;
typedef priority_queue<P, vector<P>, greater<P>> PQPG;

const int MAX_N = 2e5, MOD = 1e9 + 7, INF = 1e9;
int n, a[100], b[100], c[100], d[100];

int sq(int x, int y) {
    return x * x + y * y;
}

bool comp(const P& p1, const P& p2) {
    if (p1.fi >= 0 && p2.fi < 0) return true;
    if (p1.fi < 0 && p2.fi >= 0) return false;
    if (p1.fi == 0 && p2.fi == 0) {
        if (p1.se > 0 && p2.se < 0) return true;
        if (p1.se < 0 && p2.se > 0) return false;
        return abs(p1.se) < abs(p2.se);
    }
    if (p2.fi * p1.se == p1.fi * p2.se) 
        return sq(p1.fi, p1.se) < sq(p2.fi, p2.se);
    return p2.fi * p1.se < p1.fi * p2.se;
}

bool judge(vector<P> &x, vector<P> &y) {
    rep(i, n) {
        bool tmp = true;
        rep(j, n) if (sq(x[j].fi, x[j].se) !=
            sq(y[(j + i) % n].fi, y[(j + i) % n].se) ||
            sq(x[(j + 1) % n].fi - x[j].fi, x[(j + 1) % n].se - x[j].se) !=
            sq(y[(j + i + 1) % n].fi - y[(j + i) % n].fi,
               y[(j + i + 1) % n].se - y[(j + i) % n].se)) {
            tmp = false;
            break;
        }
        if (tmp) return true;
    }
    return false;
}

int main() {
    ci(n);
    rep(i, n) ci2(a[i], b[i]);
    rep(i, n) ci2(c[i], d[i]);
    if (n < 2) {
        co("Yes");
        return 0;
    }
    vector<P> u[n], v[n];
    rep(i, n) {
        rep(j, n) {
            if (j == i) continue;
            u[i].epb(a[j] - a[i], b[j] - b[i]);
            v[i].epb(c[j] - c[i], d[j] - d[i]);
        }
        sort(u[i].begin(), u[i].end(), comp);
        sort(v[i].begin(), v[i].end(), comp);
    }
    bool ans = false;
    rep(i, n) rep(j, n) ans |= judge(u[i], v[j]);
    if (n == 3 && 
        sq(u[0][0].fi, u[0][0].se) != sq(u[0][1].fi, u[0][1].se) &&
        sq(u[1][0].fi, u[1][0].se) != sq(u[1][1].fi, u[1][1].se) &&
        sq(u[2][0].fi, u[2][0].se) != sq(u[2][1].fi, u[2][1].se)) {
        rep(i, 3) rep(j, 3) rep(k, 2) {
            if (sq(u[i][0].fi, u[i][0].se) !=
                sq(v[i][k].fi, v[i][k].se)) continue;
            int t = (i + 1) % 2;
            if (u[i][0].fi * u[t][0].se - u[i][0].se * u[t][0].fi !=
                v[i][k].fi * v[t][k].se - v[i][k].se * v[t][k].fi) {
                co("No");
                return 0;
            }
        }
    }
    if (ans) co("Yes");
    else co("No");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define LL long long

void solve() {
    int n, ans = 0;
    cin >> n;
    vector<array<int, 2>> v(n), w(n);
    for (int i=0;i<n;++i) {
        cin >> v[i][0] >> v[i][1];
    }
    for (int i=0;i<n;++i) {
        cin >> w[i][0] >> w[i][1];
    }
    if (n == 1) {
        cout << "Yes\n";
        return;
    }
    auto dist = [](array<int, 2> a, array<int, 2> b) {
        LL x = a[0] - b[0], y = a[1] - b[1];
        return x * x + y * y;
    };
    for (int i=0;i<n;++i) {
        for (int j=0;j<n;++j) if (j != i) {
            // v[0] maps to w[i]
            // v[1] maps to w[j]
            LL r1 = dist(v[0], v[1]), r2 = dist(w[i], w[j]);
            if (r1 != r2) continue;
            // cout << i << " " << j << " match\n";

            LL av = v[1][0] - v[0][0], bv = v[1][1] - v[0][1], aw = w[j][0] - w[i][0], bw = w[j][1] - w[i][1];

            vector<array<LL, 2>> vv, ww;


            for (auto p : v) {
                p[0] -= v[0][0];
                p[1] -= v[0][1];
                vv.push_back({av * p[0] + bv * p[1], av * p[1] - bv * p[0]});
            }
            for (auto p : w) {
                p[0] -= w[i][0];
                p[1] -= w[i][1];
                ww.push_back({aw * p[0] + bw * p[1], aw * p[1] - bw * p[0]});
            }
            sort(vv.begin(), vv.end());
            sort(ww.begin(), ww.end());

            if (vv == ww) {
                cout << "Yes\n";
                return;
            }
            // for (auto p : vv) cout << p[0] << "," << p[1] << " "; cout << '\n';
            // for (auto p : ww) cout << p[0] << "," << p[1] << " "; cout << '\n';
        }
    }
    cout << "No\n";
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int t = 1;
    while (t--) {
        solve();
    }
    return 0;
}
