#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()

const string YES = "Yes";
const string NO = "No";

const double PI = 3.14159265359;

struct Gi {
    ll a, b;

    explicit Gi(ll x = 0, ll y = 0) : a(x), b(y) {}

    Gi operator*(const Gi &other) const {
        return Gi(a * other.a - b * other.b, a * other.b + b * other.a);
    }

    Gi operator-(const Gi &other) const {
        return Gi(a - other.a, b - other.b);
    }

    bool operator<(const Gi &other) const {
        if (a == other.a) return b < other.b;
        return a < other.a;
    }

    bool operator>(const Gi &other) const {
        if (a == other.a) return b > other.b;
        return a > other.a;
    }

    bool operator==(const Gi &other) const {
        return a == other.a && b == other.b;
    }

    [[nodiscard]] ll norm() const {
        return a * a + b * b;
    }
};

Gi inC() {
    ll a, b;
    cin >> a >> b;
    return Gi(a, b);
}

vector<Gi> cnv(vector<Gi> pos, Gi origin, Gi rad, int N) {
    rep(i, N) pos.at(i) = pos.at(i) - origin;
    rep(i, N) pos.at(i) = pos.at(i) * rad;
    sort(all(pos));
    return pos;
}

int main() {
    int N;
    cin >> N;
    vector<Gi> p(N), q(N);
    rep(i, N) p.at(i) = inC();
    rep(i, N) q.at(i) = inC();

    if (N == 1) {
        cout << YES << endl;
        return 0;
    }

    rep(i, N) {
        rep(j, N) {
            if (i == j) continue;
            if ((p.at(1) - p.at(0)).norm() != (q.at(j) - q.at(i)).norm()) continue;

            vector<Gi> xa = cnv(p, p.at(0), q.at(j) - q.at(i), N);
            vector<Gi> xb = cnv(q, q.at(i), p.at(1) - p.at(0), N);

            if (xa == xb) {
                cout << YES << endl;
                return 0;
            }
        }
    }

    cout << NO << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

struct Vec {
    ll x, y;
    Vec(ll _x = 0, ll _y = 0) : x(_x), y(_y) {}
    Vec operator-(const Vec &o) const {
        return {x - o.x, y - o.y};
    }
    Vec operator+(const Vec &o) const {
        return {x + o.x, y + o.y};
    }
    Vec operator*(const ll k) const {
        return {x * k, y * k};
    }
    ll operator^(const Vec &o) const {
        return x * o.y - o.x * y;
    }
    ll operator*(const Vec &o) const {
        return x * o.x + y * o.y;
    }
    bool operator==(const Vec &o) const {
        return x == o.x and y == o.y;
    }
    bool operator!=(const Vec &o) const {
        return !operator==(o);
    }
    bool upper() const {
        return x > 0 or (x == 0 and y >= 0);
    }
	int quad() const {
		if(x > 0 && y >=0) return 0;
		if(x <=0 && y > 0) return 1;
		if(x < 0 && y <=0) return 2;
		return 3;
	}
    bool operator<(const Vec &o) const {
        if(quad() != o.quad()) return quad() < o.quad();
        auto res = operator^(o);
        if(res) return res > 0;
        return (*this) * (*this) < o * o;
    }
};

vector<int> prefix_function(const auto &s) {
    int n = (int)s.size(); vector<int> b(n+1);
    b[0] = -1; int i = 0, j = -1;
    while(i < n) {
        while(j >= 0 && s[i] != s[j]) j = b[j];
        b[++i] = ++j;
    }
    return b;
}
bool kmp(const auto &text, const auto &p) {
    vector<int> b = prefix_function(p);
    int m = (int)p.size();
    int j = 0;
    for(auto c : text) {
        while(j >= 0 && c != p[j]) j = b[j];
        j++;
        if(j == m) {
            return true;
        }
    }
    return false;
}

auto read(int n) {
    vector<Vec> pt(n);
    Vec center;
    for(Vec &p : pt) {
        scanf("%lld %lld", &p.x, &p.y);
        center = center + p;
    }
    
    for(Vec &p : pt) p = p * n - center;
    for(int i = 0; i < (int)pt.size(); i++) {
        while(i < (int)pt.size() and pt[i] == Vec()) {
            swap(pt[i], pt.back());
            pt.pop_back();
        }
    }

    for(Vec p : pt) assert(p != Vec());
    
    sort(pt.begin(), pt.end());

    n = (int)pt.size();

    vector<tuple<ll, ll, ll>> vec; vec.reserve(n);
    for(int i = 0; i < n; i++) {
        ll cross = pt[i] ^ pt[(i + 1) % n];
        ll dot = pt[i] * pt[(i + 1) % n];
        ll size = pt[i] * pt[i];
        vec.push_back({cross, dot, 0});
    }
    return vec;
}

int main() {

    int n;
    scanf("%d", &n);
    if(n == 1) return printf("Yes\n"), 0;

    auto s = read(n);
    auto t = read(n);

    if(s.size() != t.size()) return printf("No\n"), 0;

    for(int i = 0; i < (int)t.size(); i++) s.push_back(s[i]);

    printf("%s\n", kmp(s, t) ? "Yes" : "No");
}
