// coached by Dukkha and rainboy
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 100;

int aa[N], bb[N], cc[N], dd[N];
int pp[N], qq[N], ii[N];
int rr[N], ss[N], jj[N];

int cross(int x1, int y1, int x2, int y2) {
	return x1 * y2 - x2 * y1;
}

int dot(int x1, int y1, int x2, int y2) {
	return x1 * x2 + y1 * y2;
}

void convert(int *aa, int *bb, int *pp, int *qq, int n, int x1, int y1, int i2) {
	int x2 = aa[i2], y2 = bb[i2];
	for (int i = 0; i < n; i++) {
		int x = aa[i], y = bb[i];
		pp[i] = cross(x - x1, y - y1, x2 - x1, y2 - y1);
		qq[i] = dot(x - x1, y - y1, x2 - x1, y2 - y1);
	}
}

int main() {
	int n; cin >> n;
	if (n == 1) {
		cout << "Yes\n";
		return 0;
	}
	int xa = 0, ya = 0;
	for (int i = 0; i < n; i++) {
		cin >> aa[i] >> bb[i];
		xa += aa[i], ya += bb[i];
		aa[i] *= n, bb[i] *= n;
	}
	int xb = 0, yb = 0;
	for (int i = 0; i < n; i++) {
		cin >> cc[i] >> dd[i];
		xb += cc[i], yb += dd[i];
		cc[i] *= n, dd[i] *= n;
	}
	for (int i2 = 0; i2 < n; i2++)
		if (aa[i2] != xa || bb[i2] != ya) {
			convert(aa, bb, pp, qq, n, xa, ya, i2);
			break;
		}
	for (int h = 0; h < n; h++)
		ii[h] = h;
	sort(ii, ii + n, [] (int i, int j) { return pp[i] < pp[j] || pp[i] == pp[j] && qq[i] < qq[j]; });
	for (int i2 = 0; i2 < n; i2++)
		if (cc[i2] != xb || dd[i2] != yb) {
			convert(cc, dd, rr, ss, n, xb, yb, i2);
			for (int h = 0; h < n; h++)
				jj[h] = h;
			sort(jj, jj + n, [] (int i, int j) { return rr[i] < rr[j] || rr[i] == rr[j] && ss[i] < ss[j]; });
			bool yes = true;
			for (int h = 0; h < n; h++) {
				int i = ii[h], j = jj[h];
				if (pp[i] != rr[j] || qq[i] != ss[j]) {
					yes = false;
					break;
				}
			}
			if (yes) {
				cout << "Yes\n";
				return 0;
			}
		}
	cout << "No\n";
	return 0;
}

// 問題の 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;
}
