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

constexpr double eps = 1e-9;
double o;
double pi2 = 2 * acos(-1);

struct P {
    bool operator!=(const P &p) const {
        double z = t - p.t - o;
        z = z - round(z / pi2) * pi2;
        return !(abs(z) < eps && r2 == p.r2);
    }
    bool operator<(const P &p) const {
        //return r2 != p.r2 ? r2 < p.r2 : t < p.t;
        return abs(t - p.t) > eps ? t < p.t : r2 < p.r2;
    }
    int x, y;
    int r2;
    double t;
};

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

    vector<P> p(n), q(n);
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        p[i] = { x, y, 0, 0 };
    }
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        q[i] = { x, y, 0, 0 };
    }

    p[0].r2 = 0;
    p[0].t = -100;
    for (int i = 1; i < n; i++) {
        int x = p[i].x - p[0].x;
        int y = p[i].y - p[0].y;
        p[i].r2 = x * x + y * y;
        p[i].t = atan2(y, x);
    }
    sort(p.begin(), p.end());

    for (int j = 0; j < n; j++) {
        vector<P> r = q;
        swap(r[j], r[0]);
        r[0].r2 = 0;
        r[0].t = -100;
        for (int i = 1; i < n; i++) {
            int x = r[i].x - r[0].x;
            int y = r[i].y - r[0].y;
            r[i].r2 = x * x + y * y;
            r[i].t = atan2(y, x);
        }
        sort(r.begin(), r.end());

        for (int h = 0; h < n; h++) {
            int f = 1;
            int i1 = 1 + h;
            if (i1 >= n) i1 -= n - 1;
            o = p[1].t - r[i1].t;
            for (int i = 1; i < n; i++) {
                int i1 = i + h;
                if (i1 >= n) i1 -= n - 1;
                if (p[i] != r[i1]) {
                    f = 0;
                    break;
                }
            }
            if (f) {
                //cout << j << ' ' << h << endl;
                cout << "Yes" << endl;
                exit(0);
            }
        }
    }
    cout << "No" << endl;

    return 0;
}
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int n;
struct point{
	int x,y;
}a[110],b[110];
double dx[110],dy[110];
double abss(double x){return (x<0)?-x:x;}
int main()
{
	scanf("%d",&n);
	if (n==1) {printf("Yes");return 0;}
	for (int i=1;i<=n;i++)
		scanf("%d%d",&a[i].x,&a[i].y);
	for (int i=1;i<=n;i++)
		scanf("%d%d",&b[i].x,&b[i].y);
	int len=(a[1].x-a[2].x)*(a[1].x-a[2].x)+(a[1].y-a[2].y)*(a[1].y-a[2].y);
	int ax=a[1].x-a[2].x,ay=a[1].y-a[2].y;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
		{
			if (i==j) continue;
			if (((b[i].x-b[j].x)*(b[i].x-b[j].x)+(b[i].y-b[j].y)*(b[i].y-b[j].y))!=len) continue;
			int bx=b[i].x-b[j].x,by=b[i].y-b[j].y;
			double sina=1.0*(1.0*ax*by-ay*bx)/len;
			double cosa=sqrt(1.0-sina*sina);
			for (int m=-1;m<=1;m+=2)
			{
				
				//cout<<i<<" "<<j<<endl;
				if (ax!=bx||ay!=by)
				{
					for (int k=1;k<=n;k++)
					{
						dx[k]=a[k].x*cosa-a[k].y*sina;
						dy[k]=a[k].y*cosa+a[k].x*sina;
					//	cout<<k<<" :: "<<dx[k]<<" "<<dy[k]<<endl;
					}	
				}
				else
				{
					for (int k=1;k<=n;k++)
					{
						dx[k]=a[k].x;
						dy[k]=a[k].y;
					//	cout<<k<<": "<<dx[k]<<" "<<dy[k]<<endl;
					}
				}
				double cx=b[i].x-dx[1],cy=b[i].y-dy[1];
				for (int k=1;k<=n;k++)
				{
					dx[k]+=cx;
					dy[k]+=cy;
				//	cout<<dx[k]<<" "<<dy[k]<<endl;
				}
				
				//judge
				bool yes=1;
				for (int k=1;k<=n;k++)
				{
					bool can=0;
					for (int q=1;q<=n;q++)
						if (abss(dx[k]-b[q].x)<=1e-6&&abss(dy[k]-b[q].y)<=1e-6)
							{can=1;break;}
					if (!can) {yes=0;break;}
				}
				if (yes) {printf("Yes\n");return 0;}
				cosa*=-1;
			//printf("%d %d %f %f %d %d\n",i,j,sina,cosa,rx,ry);
			}
		}
	printf("No\n");
}
