#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll INF = 1LL << 60;

struct C{
  int x, y;
  C( int x = 0, int y = 0 ): x(x), y(y) {}
  C operator*( const C& a ) const {
	return C( x*a.x - y*a.y, x*a.y+y*a.x );
  }
  C operator-( const C&a ) const{
	return C( x-a.x , y-a.y );
  }
  bool operator<( const C& a ) const{
	if( x == a.x ) return y < a.y;
	return x < a.x;
  }
  bool operator==( const C& a ) const{
	return x == a.x && y == a.y;
  }
  int norm() const {
	return x*x+y*y;
  }

};

vector<C> MoveRot( vector<C> p, C move, C rot ){

  int N = p.size();
  for( int i = 0; i < N; i++ ){
	p[i] = p[i] - move;
  }
  for( int i = 0; i < N; i++ ){
	p[i] = p[i] * rot;
  }
  sort( p.begin(), p.end() );
  return p;
  
}

int main(){

  ll N;
  cin >> N;
  vector<C> a(N), b(N);
  for( int i = 0; i < N; i++ ){
	int x, y;
	cin >> x >> y;
	a[i] = C(x,y);
  }
  for( int i = 0; i < N; i++ ){
	int x, y;
	cin >> x >> y;
	b[i] = C(x,y);
  }

  if( N == 1 ){
	cout << "Yes" << endl;
	return 0;
  }
  
  for( int i = 0; i < N; i++ ){
	for( int j = 0; j < N; j++ ){

	  if( i == j ) continue;
	  if( (a[1]-a[0]).norm() != (b[j]-b[i]).norm() ) continue;
	  
	  vector<C> ap = MoveRot( a, a[0], b[j]-b[i] );
	  vector<C> bp = MoveRot( b, b[i], a[1]-a[0] );
	  if( ap == bp ){
		cout << "Yes" << endl;
		return 0;
	  }
	  
	}
  }

  cout << "No" << endl;
  
  return 0;

}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define each(e, v) for(auto &e: v)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
//const int MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

struct io_setup{
    io_setup(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout << fixed << setprecision(15);
    }
} io_setup;

int dot(int x1, int y1, int x2, int y2){
    return x1*x2+y1*y2;
}

int det(int x1, int y1, int x2, int y2){
    return x1*y2-x2*y1;
}

int main(){
    int N; cin >> N;
    if(N == 1) {cout << "Yes\n"; return 0;}

    vector<int> a(N), b(N), c(N), d(N);

    rep(i, N) cin >> a[i] >> b[i];
    rep(i, N) cin >> c[i] >> d[i];

    int x1 = a[1]-a[0], y1 = b[1]-b[0];
    int r = dot(x1, y1, x1, y1);

    vector<pii> p;
    rep2(i, 2, N-1){
        int x2 = a[i]-a[0], y2 = b[i]-b[0];
        p.eb(dot(x1, y1, x2, y2), det(x1, y1, x2, y2));
    }
    sort(all(p));

    rep(i, N) rep(j, N){
        if(i == j) continue;
        int X1 = c[j]-c[i], Y1 = d[j]-d[i];
        int R = dot(X1, Y1, X1, Y1);
        if(r != R) continue;
        //cout << i << ' ' << j << '\n';

        vector<pii> q;
        rep(k, N){
            if(k == i || k == j) continue;
            int X2 = c[k]-c[i], Y2 = d[k]-d[i];
            q.eb(dot(X1, Y1, X2, Y2), det(X1, Y1, X2, Y2));
        }

        sort(all(q));
        if(p == q) {cout << "Yes\n"; return 0;}
    }

    cout << "No\n";
}