#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

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

    vector <vector<int>> p(N, vector<int>(2));
    vector <double> store(N);
    rep(i, N)
        cin >> p[i][0] >> p[i][1];

    int x, y;
    double r;
    rep(i, N)
    {
        x = p[i][0];
        y = p[i][1];
        // cout << "xy" << x << y << endl;
        rep2(j, i + 1, N)
        {
            // cout << " xy" << p[j][0] << p[j][1] << endl;
            if (p[j][0] == x)
                r = INT_MAX;
            else
                r = double(p[j][1] - y) / double(p[j][0] - x);
            store[j] = r;
            for(int k = j-1; k > i; k--){
                if (store[k] == store[j]){
                    // cout << "jk" << j << k << " : " << store[j] << store[k] << endl;
                    // cout << p[j][0] << p[j][1] << " & " << p[k][0] << p[k][1] << endl;
                    // r = double(p[j][1] - y) / double(p[j][0] - x);
                    // cout << r <<endl;
                    // r = double(p[k][1] - y) / double(p[k][0] - x);
                    // cout << r <<endl;
                    // rep(n, N) cout << store[n] << ", ";
                    cout << "Yes" << endl;
                    exit(0);
                }
            }
        }
    }
    cout << "No" << endl;
}

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

double EPS = 1e-9;

double square(double x)
{
    return x * x;
}

int main()
{
    vector<array<double, 2>> set1;
    vector<array<double, 2>> set2;

    int n;
    cin >> n;

    if (n == 1)
    {
        cout << "Yes" << endl;
        return 0;
    }
    for (int i = 0; i < n; i++)
    {
        double x, y;
        cin >> x;
        cin >> y;
        array<double, 2> point = {x, y};
        set1.push_back(point);
    }

    for (int i = 0; i < n; i++)
    {
        double x, y;
        cin >> x;
        cin >> y;
        array<double, 2> point = {x, y};
        set2.push_back(point);
    }

    double set1_x_avg = 0, set1_y_avg = 0;
    for (auto point : set1)
    {
        set1_x_avg += point[0];
        set1_y_avg += point[1];
    }
    set1_x_avg /= set1.size();
    set1_y_avg /= set1.size();

    double set2_x_avg = 0, set2_y_avg = 0;
    for (auto point : set2)
    {
        set2_x_avg += point[0];
        set2_y_avg += point[1];
    }
    set2_x_avg /= set2.size();
    set2_y_avg /= set2.size();

    // now we have the centroids
    // cout << "centroid1 " << set1_x_avg << " " << set1_y_avg << endl;
    // cout << "centroid2 " << set2_x_avg << " " << set2_y_avg << endl;

    // normalize
    for (auto &point : set1)
    {
        point[0] -= set1_x_avg;
        point[1] -= set1_y_avg;
        // cout << point[0] << " " << point[1] << endl;
    }

    for (auto &point : set2)
    {
        point[0] -= set2_x_avg;
        point[1] -= set2_y_avg;
        // cout << point[0] << " " << point[1] << endl;
    }

    // loop over every pair
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            double d1 = sqrt(square(set1[i][0]) + square(set1[i][1]));
            double d2 = sqrt(square(set2[j][0]) + square(set2[j][1]));

            if (d1 < EPS || abs(d1 - d2) > EPS)
            {
                continue;
            }

            double t = atan2(set2[j][1], set2[j][0]) - atan2(set1[i][1], set1[i][0]);

            for (int k = (0); k < n; k++)
            {
                auto O3U4gd88 = ((set1[k][0] * cos(t) - set1[k][1] * sin(t)));
                auto H31bcJ8S = ((set1[k][0] * sin(t) + set1[k][1] * cos(t)));
                set1[k][0] = O3U4gd88;
                set1[k][1] = H31bcJ8S;
            }

            /*vector<array<double, 2>> rot_set1;
            for (int k = 0; k < n; k++)
            {
                double rotx = set1[k][0] * cos(t) - set1[k][1] * sin(t);
                double roty = set1[k][0] * sin(t) + set1[k][1] * cos(t);
                array<double, 2> a = {rotx, roty};
                rot_set1.push_back(a);
            } */

            bool polygons_identical = true;
            // for each point check if there is this identical point in the other set
            for (int k = 0; k < n; k++)
            {
                bool has_match = false;
                for (int l = 0; l < n; l++)
                {
                    if (abs(set1[k][0] - set2[l][0]) <= EPS && abs(set1[k][1] - set2[l][1]) <= EPS)
                    {
                        has_match = true;
                        break;
                    }
                }
                polygons_identical &= has_match;
                if (!has_match)
                    break;
            }
            if (polygons_identical)
            {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}