#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";
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define rrep(i, a, b) for (ll i = b - 1; a <= i; i--)
ll MOD = 1000000007;
ll MOD2 = 998244353;

ll N;
vector<pair<ll, ll>> S, T;
vector<vector<vector<ll>>> rotation;

int main () {
  cin >> N;
  rep (i, 0, N) {
    ll x, y;
    cin >> x >> y;
    S.push_back(make_pair(x * N, y * N));
  }
  rep (i, 0, N) {
    ll x, y;
    cin >> x >> y;
    T.push_back(make_pair(x * N, y * N));
  }

  if (N == 1) {
    cout << "Yes";
    return 0;
  }

  {
    ll x0, y0;
    x0 = y0 = 0;
    rep (i, 0, N) {
      x0 += S[i].first;
      y0 += S[i].second;
    }
    x0 /= N, y0 /= N;
    rep (i, 0, N) {
      S[i].first -= x0;
      S[i].second -= y0;
    }

    x0 = y0 = 0;
    rep (i, 0, N) {
      x0 += T[i].first;
      y0 += T[i].second;
    }
    x0 /= N, y0 /= N;
    rep (i, 0, N) {
      T[i].first -= x0;
      T[i].second -= y0;
    }
  }
  sort(T.begin(), T.end());

  // cout << "S\n";
  // rep (i, 0, N) cout << S[i].first << " " << S[i].second << endl;
  // cout << "\nT\n";
  // rep (i, 0, N) cout << T[i].first << " " << T[i].second << endl;

  {
    ll k = -1, denom = 0;
    while (denom == 0) {
      k++;
      denom = T[k].first * T[k].first + T[k].second * T[k].second;
    }

    // cout << T[k].first << " " << T[k].second << " " << denom << endl;

    rep (i, 0, N) {
      ll denom2 = S[i].first * S[i].first + S[i].second * S[i].second;
      if (denom != denom2) continue;
      ll sin_nume, cos_nume;
      sin_nume = S[i].first * T[k].second - S[i].second * T[k].first;
      cos_nume = S[i].first * T[k].first + S[i].second * T[k].second;

      vector<vector<ll>> r = {
        {cos_nume, -sin_nume},
        {sin_nume, cos_nume},
        {denom}
      };
      rotation.push_back(r);
    }
  }

  // for (auto r : rotation) {
  //   cout << r[0][0] << " " << r[0][1] << " "<< r[1][0] << " "<< r[1][1] << " "<< r[2][0] << "\n";
  // }

  for (const auto& r : rotation) {
    vector<pair<ll, ll>> U;
    bool flag = 0;
    rep (i, 0, N) {
      auto [x1, y1] = S[i];
      ll x2 = x1 * r[0][0] + y1 * r[0][1];
      ll y2 = x1 * r[1][0] + y1 * r[1][1];

      if (x2 % r[2][0] != 0) flag = true;
      if (y2 % r[2][0] != 0) flag = true;
      if (flag) break;

      x2 /= r[2][0];
      y2 /= r[2][0];
      U.push_back(make_pair(x2, y2));
    }
    if (flag) {
      // cout << "coor in not an integer\n";
      continue;
    }
    sort(U.begin(), U.end());

    // cout << "\nU\n";
    // rep (i, 0, N) cout << U[i].first << " " << U[i].second << endl;

    rep (i, 0, N) {
      if (T[i] != U[i]) {
        flag = true;
        break;
      }
    }
    if (flag) {
      // cout << "coor dont match\n";
      continue;
    }
    else {
      cout << "Yes";
      return 0;
    }
  }

  cout << "No";
  return 0;
}
