#include <bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//#include <atcoder/all>
using namespace std;
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a; i > -1; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a; i > b; --i)
#define repl(i, a) for (ll i = (ll)0; i < (ll)a; ++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define fi first
#define se second
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll mod_998244353 = 998244353;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")

// using lll=boost::multiprecision::cpp_int;
// using
// Double=boost::multiprecision::number<boost::multiprecision::cpp_dec_float<128>>;//仮数部が1024桁
template <class T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}

ll mypow(ll x, ll n, const ll &p = -1)
{ // x^nをmodで割った余り

  if (p != -1)
  {
    x = (x % p + p) % p;
  }
  ll ret = 1;
  while (n > 0)
  {
    if (n & 1)
    {
      if (p != -1)
        ret = (ret * x) % p;
      else
        ret *= x;
    }
    if (p != -1)
      x = (x * x) % p;
    else
      x *= x;
    n >>= 1;
  }
  return ret;
}

struct myrand{
  random_device seed;
  mt19937 mt;
  myrand():mt(seed()){}
  int operator()(int a,int b){//[a,b)
    uniform_int_distribution<int>dist(a,b-1);
    return dist(mt);
  }
};

//using namespace atcoder;

//------------------------
//------------------------
//------------------------
//------------------------
//------------------------

using P=pair<long double,long double>;
long double eps=1e-8;
void solve()
{
	int n;
	cin>>n;
	vector<long double>a(n),b(n),c(n),d(n);
	long double ga=0,gb=0,gc=0,gd=0;
	rep(i,n)cin>>a[i]>>b[i],ga+=a[i],gb+=b[i],a[i]*=n,b[i]*=n;
	rep(i,n)cin>>c[i]>>d[i],gc+=c[i],gd+=d[i],c[i]*=n,d[i]*=n;
	if(n==1){
		cout<<"Yes\n";
		return;
	}

	int cnt=0,cnt2=0;
	rep(i,n){
		a[i]-=ga,b[i]-=gb;
		c[i]-=gc,d[i]-=gd;
		if(abs(a[i])<eps&&abs(b[i])<eps)++cnt;
		if(abs(c[i])<eps&&abs(d[i])<eps)++cnt2;
	}
	if(cnt!=cnt2){
		cout<<"No\n";
		return;
	}
	vector<P>q(n);
	rep(i,n)q[i]={c[i],d[i]};

	auto mul=[](long double x,long double y,long double arg)->P{
		P ret={cos(arg)*x+sin(arg)*y,-sin(arg)*x+cos(arg)*y};
		return ret;
	};

	auto myequal=[](P &x,P &y)->bool{
		return abs(x.fi-y.fi)<eps&&abs(x.se-y.se)<eps;
	};
	int id=0;
	if(abs(a[id])<eps&&abs(b[id])<eps)id=1;
	rep(t,n){
		if(abs(c[t])<eps&&abs(d[t])<eps)continue;
		vector<P>p(n);
		long double argx=atan2(b[id],a[id]),argy=atan2(d[t],c[t]);
		long double arg_sub=argx-argy;
		rep(i,n){
			p[i]=mul(a[i],b[i],arg_sub);
		}
		
		vector<bool>used(n);
		bool ng=false;
		rep(i,n){
			bool flag=false;
			rep(j,n){
				if(!used[j]&&myequal(p[i],q[j])){
					used[j]=true;
					flag=true;
					break;
				}
			}
			if(!flag){
				ng=true;
				break;
			}
		}


		if(!ng){
			cout<<"Yes\n";
			return;
		}
	}
	cout<<"No\n";
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);
  solve();
  return 0;
}
#include <algorithm>
#include <iostream>
#include <string>
#include <functional>
#include <vector>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cmath>
#include <climits>
#include <queue>
#include <bitset>
#include <set>
#include <assert.h>
#include <map>
using namespace std;
typedef vector<vector<long> > dim2veclo;
typedef vector<vector<int> > dim2vecin;
typedef vector<vector<double> > dim2vecdo;
typedef vector<vector<long long> > dim2vecll;
typedef vector<int> vecin;
typedef vector<long> veclo;
typedef vector<double> vecdo;
typedef vector<long long> vecll;
typedef vector<bool> vecbo;
typedef vector<vector<bool> > dim2vecbo;
typedef long long ll;
typedef vector < pair<ll, ll> > vecpa;
typedef vector<string> vecst;
typedef pair<ll, ll> pail;
typedef pair<int, int> pain;
typedef vector<vecpa > dim2vecpa;


#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = { -1, 0, 1, 0 };
int dy[4] = { 0, 1, 0, -1 };

const ll MOD = 1000000007;

int dist(double x1, double y1, double x2, double y2) {
    return (int)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int angG(double X, double Y, double x2, double y2, double x3, double y3) {
    double gaiseki = (x2 - X) * (y3 - Y) - (y2 - Y) * (x3 - X);
    return (int)(asin(gaiseki / (dist(X, Y, x2, y2) * dist(X, Y, x3, y3))) * 100000);
}

int angN(double X, double Y, double x2, double y2, double x3, double y3) {
    double naiseki = (x2 - X) * (x3 - X) + (y2 - Y) * (y3 - Y);
    return (int)(acos(naiseki / (dist(X, Y, x2, y2) * dist(X, Y, x3, y3))) * 100000);
}



int main() {
    int n; cin >> n;
    vecdo a = vecdo(n);
    vecdo b = vecdo(n);
    vecdo c = vecdo(n);
    vecdo d = vecdo(n);
    rep(i, n) cin >> a[i] >> b[i];
    rep(i, n) cin >> c[i] >> d[i];
    if (n == 1) {
        cout << "Yes";
        return 0;
    }
    if (n == 2) {
        if (dist(a[0], b[0], a[1], b[1]) == dist(c[0], d[0], c[1], d[1])) {
            cout << "Yes";
        }
        else cout << "No";
        return 0;
    }

    ll length = dist(a[0], b[0], a[1], b[1]);

    bool res = false;
    
    vector<pair<int, pair<int, int>>> ans = vector<pair<int, pair<int, int>>>(n - 2);
    for (int i = 2; i < n; i++) {
        ans.push_back(make_pair(dist(a[0], b[0], a[i], b[i]), make_pair(angN(a[0], b[0], a[1], b[1], a[i], b[i]), angG(a[0], b[0], a[1], b[1], a[i], b[i]))));
    }
    sort(ans.begin(), ans.end());

    rep(i, n) rep(j, n) {
        if (i == j) continue;
        if (length != dist(c[i], d[i], c[j], d[j])) continue;
        bool flag = true;
        rep(k, n) {
            if (i == k) continue;
            if (j == k) continue;
            pair<int, pair<int, int>> isOK = make_pair(dist(c[i], d[i], c[k], d[k]), make_pair(angN(c[i], d[i], c[j], d[j], c[k], d[k]), angG(c[i], d[i], c[j], d[j], c[k], d[k])));
            if (!binary_search(ans.begin(), ans.end(), isOK)) {
                flag = false;
                break;
            }
        }
        if (flag) {
            res = true;
            break;
        }
    }
    if (res) cout << "Yes";
    else cout << "No";



    return 0;
}