#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); (i)++)
#define per(i, n) for (ll i = n - 1; i >= 0; (i)--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define ROF(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define ALL(x) std::begin(x), std::end(x)
#define rALL(x) std::rbegin(x), std::rend(x)
#define fi first
#define se second
typedef long long ll;
typedef long double ld;

const ld eps = 1e-9;
inline ld cross(ld x1, ld y1, ld x2, ld y2) { return x1 * y2 - x2 * y1; } // (x1, y1)と(x2, y2)の外積, 1->2で反時計回りなら正
inline ld dot(ld x1, ld y1, ld x2, ld y2) { return x1 * x2 + y1 * y2; } // (x1, y1)と(x2, y2)の内積
inline ld norm2(ld x, ld y) { return x * x + y * y; } // ノルム二乗
inline ld cross(pair<ld, ld> a, pair<ld, ld> b) { return a.fi * b.se - b.fi * a.se; }
inline ld dot(pair<ld, ld> a, pair<ld, ld> b) { return a.fi * b.fi + a.se * b.se; }
inline ld norm2(pair<ld, ld> a) { return a.fi * a.fi + a.se * a.se; }
inline bool isSame(ld a, ld b) { if(std::abs(a-b) < eps) return true; else return false; }
inline bool comp(ld a, ld b) { if(a + eps < b) return true; else return false; }
inline bool compp(pair<ld, ld> a, pair<ld, ld> b) { if(a.first + eps < b.first || (isSame(a.first, b.first) && a.second + eps < b.second)) return true; else return false;}

int main(){
    //input, initialize
    int N; cin >> N;
    vector<ld> a(N), b(N), c(N), d(N);
    rep(i, N) cin >> a[i] >> b[i];
    rep(i, N) cin >> c[i] >> d[i]; 
    //solve
    if(N == 1) {cout << "Yes\n"; return 0;}
    pair<ld, ld> c1, c2;
    rep(i, N) {c1.fi += a[i]; c1.se += b[i]; c2.fi += c[i]; c2.se += d[i];}
    c1.fi /= N; c1.se /= N; c2.fi /= N; c2.se /= N;
    rep(i, N) {a[i] -= c1.fi; b[i] -= c1.se; c[i] -= c2.fi; d[i] -= c2.se;}

    if(isSame(a[0], 0.0l) && isSame(b[0], 0.0l)) {swap(a[0], a[1]); swap(b[0], b[1]);}
    vector<pair<ld, ld>> p1, p2;
    rep(i, N)
        p1.emplace_back(make_pair( cross(a[0],b[0],a[i],b[i]), dot(a[0],b[0],a[i],b[i]) ));
    sort(ALL(p1), compp);
    
    rep(i, N){
        p2 = {};
        if(isSame(c[i], 0.0) && isSame(d[i], 0.0)) continue;
        rep(j, N)
            p2.emplace_back(make_pair( cross(c[i],d[i],c[j],d[j]), dot(c[i],d[i],c[j],d[j]) ));
        sort(ALL(p2), compp);

        bool isok = true;
        rep(i, N){
            if( !isSame(p1[i].fi, p2[i].fi) || !isSame(p1[i].se, p2[i].se) ){
                isok = false;
                break;
            }
        }
        if(isok) {cout << "Yes\n"; return 0;}
    }
    //output
    cout << "No\n";
    //debug
}
#include<bits/stdc++.h>
using namespace std;
#define N 2005
#define db double
const db eps=1e-3,pi=3.14159265358979323846264337328451;
int n,t,j,i,cnt,tot,a[N],b[N],ans,c[N],d[N];
db alp,ang,dis;
struct dot{db x,y;}dt[N],R[N];
inline bool eq(db aa,db bb){
	return aa<bb+eps&&bb<aa+eps;
}
inline bool cmp(dot aa,dot bb){
	if(eq(aa.x,bb.x))return aa.y<bb.y;
	return aa.x<bb.x;
}
bool check(db alp){
	int i;
	for(i=1;i<=n;++i){
		dis=sqrt((a[i]*a[i]+b[i]*b[i]));
		ang=atan2(b[i],a[i])+alp;
		dt[i].x=cos(ang)*dis;
		dt[i].y=sin(ang)*dis;
	}
	sort(dt+1,dt+n+1,cmp);
	db x=dt[1].x-R[1].x,y=dt[1].y-R[1].y;
	for(i=2;i<=n;++i){
		if(eq(dt[i].x-R[i].x,x)&&eq(dt[i].y-R[i].y,y))continue;
		else return 0;
	}
	return 1;
}
int main(){
	cin>>n;
	for(i=1;i<=n;++i){
		cin>>a[i]>>b[i];
	}
	for(i=1;i<=n;++i){
		cin>>c[i]>>d[i];
		R[i].x=c[i];R[i].y=d[i];
	}
	sort(R+1,R+n+1,cmp);
	for(i=-40;i<=40;++i){
		for(j=-40;j<=40;++j){
			if(check(atan2(j,i))){
				return cout<<"Yes",0;
			}
		}
	}
	cout<<"No";
}