#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}
void OUTX2(){cout << endl;}
template<typename Head, typename... Tail>
void OUTX2(Head&& head, Tail&&... tail)
{
    cout << head << ' ';
    OUTX2(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define __LONG_LONG_MIN__ (-__LONG_LONG_MAX__ - 1)

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

ll gcd(ll a, ll b)
{
    if(a < b) swap(a, b);
    while(b > 0)
    {
        a %= b;
        swap(a, b);
    }
    return a;
}

int main()
{
    ll N;
    INX(N);
    ll N2 = (1 << N) - 1;

    vll chk(51, 51);
    for (ll i = 0; i <= 50; i++)
    {
        chk[i] = i;
    }
    for (ll i = 2; i <= 50; i++)
    {
        ll i2 = i;
        while(i2 <= 50)
        {
            chk[i2] = min(chk[i2], i);
            i2 += i;
        }
    }

    vll fact;
    for (ll i = 2; i <= 50; i++)
    {
        if(chk[i] == i) fact.ADD(i);
    }
    

    vll X(N);
    for (ll i = 0, ibit = 1; i < N; i++, ibit <<= 1)
    {
        INX(X[i]);
    }

    ll result = __LONG_LONG_MAX__;
    for (ll i = 1, endi = 1 << fact.size(); i < endi; i++)
    {
        ll candi = 1;
        for(ll j = 0, j2 = i; j2 > 0; j++, j2 >>= 1)
        {
            if(j2 & 1) candi *= fact[j];
        }

        bool isok = true;
        for (ll j = 0; j < N; j++)
        {
            if(gcd(X[j], candi) == 1)
            {
                isok = false;
                break;
            }
        }
        
        if(isok)
        {
            result = min(result, candi);
        }
    }
    OUTX(result);
    

    return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pii pair<double,double>
#define eps 1e-8
#define equals(a,b) fabs(a - b) < eps
using namespace std;

typedef long long ll;

ll rd(){
	ll x;
	scanf("%lld",&x);
	return x;
}

double dis(pii a,pii b){
	return sqrt((a.fi - b.fi) * (a.fi - b.fi) + (a.se - b.se) * (a.se - b.se));
}

pii c1,c2;

bool cmp1(pii a,pii b){
	return atan2(a.se - c1.se,a.fi - c1.fi) < atan2(b.se - c1.se,b.fi - c1.fi);
}

bool cmp2(pii a,pii b){
	return atan2(a.se - c2.se,a.fi - c2.fi) < atan2(b.se - c2.se,b.fi - c2.fi);
}

double cross(pii a,pii b){
	return a.fi * b.se - a.se * b.fi;
}

double dot(pii a,pii b){
	return a.fi * b.fi + a.se * b.se;
}

pii operator - (const pii &a,const pii &b){
	return make_pair(a.fi - b.fi,a.se - b.se);
}

int main(){
	int n = rd();
	double mi1 = 1e9;
	double mx1 = 0;
	double mi2 = 1e9;
	double mx2 = 0;
	vector<pii> p1,p2;
	vector<double> dis1,dis2;
	for(int i = 1;i <= n;i++){
		int a = rd();
		int b = rd();
		c1.fi += a;
		c1.se += b;
		p1.push_back(make_pair(a,b));
	}
	c1.fi /= n;
	c1.se /= n;
	if(n == 1) {
		puts("Yes");
		return 0;
	}
	for(int i = 1;i <= n;i++){
		int a = rd();
		int b = rd();
		c2.fi += a;
		c2.se += b;
		p2.push_back(make_pair(a,b));
	}
	c2.fi /= n;
	c2.se /= n;

	for(int i = 0;i < n;i++){
		p1[i].fi -= c1.fi;
		p1[i].se -= c1.se;
		p2[i].fi -= c2.fi;
		p2[i].se -= c2.se;
	}

	for(int i = 0;i < n;i++){
		if(p1[i].fi || p1[i].se) {
			swap(p1[0].fi,p1[i].fi);
			swap(p1[0].se,p1[i].se);
		}
	}

	bool flag = false;
	for(int i = 0;i < 1;i++){
		for(int j = 0;j < n;j++){
			double ang = atan2(p1[i].se,p1[i].fi) - atan2(p2[j].se,p2[j].fi);
			int cnt = 0;
			for(int k = 0;k < n;k++){
				bool f = 0;
				for(int kk = 0;kk < n;kk++){
					double x = cos(ang) * p2[kk].fi - sin(ang) * p2[kk].se;
					double y = sin(ang) * p2[kk].fi + cos(ang) * p2[kk].se;
					f |= (equals(x,p1[k].fi) && equals(y,p1[k].se));
				}
				if(!f) break;		
				else cnt++;
			}
			flag |= (cnt == n);
		}
	}
	if(flag) puts("Yes");
	else puts("No");
}




