#include<iostream>
#include<set>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int N;
vector<pair<int,int> >S,T;
const double EPS=1e-7;
bool eq(double x,double y){return abs(x-y)<EPS;}
main()
{
	cin>>N;
	for(int i=0;i<N;i++)
	{
		int x,y;cin>>x>>y;
		S.push_back(make_pair(x,y));
	}
	for(int i=0;i<N;i++)
	{
		int x,y;cin>>x>>y;
		T.push_back(make_pair(x,y));
	}
	if(N==1)
	{
		cout<<"Yes"<<endl;
		return 0;
	}
	for(pair<int,int>p:S)
	{
		pair<int,int>q=T[0];
		map<int,vector<double> >s,t;
		for(pair<int,int>r:S)if(r!=p)
		{
			int dx=r.first-p.first,dy=r.second-p.second;
			s[dx*dx+dy*dy].push_back(atan2(dy,dx));
		}
		for(pair<int,int>r:T)if(r!=q)
		{
			int dx=r.first-q.first,dy=r.second-q.second;
			t[dx*dx+dy*dy].push_back(atan2(dy,dx));
		}
		vector<double>X;
		for(pair<int,vector<double> >PP:s)
		{
			vector<double>P=PP.second,Q=t[PP.first];
			if(Q.size()!=P.size())
			{
				X.clear();
				break;
			}
			vector<double>now;
			sort(P.begin(),P.end());
			sort(Q.begin(),Q.end());
			for(int i=0;i<P.size();i++)
			{
				double X=P[i]-Q[0];
				if(X<0)X+=2*M_PI;
				bool ok=true;
				for(int j=0;j<Q.size();j++)
				{
					int id=i+j;
					if(id>=P.size())id-=P.size();
					double Y=P[id]-Q[j];
					if(Y<0)Y+=2*M_PI;
					if(!eq(X,Y))
					{
						ok=false;
						break;
					}
				}
				if(ok)now.push_back(X);
			}
			if(X.empty())X=now;
			else
			{
				sort(now.begin(),now.end());
				vector<double>nX;
				int xi=0;
				for(double p:now)
				{
					while(xi<X.size()&&X[xi]+EPS<p)xi++;
					if(xi<X.size()&&eq(X[xi],p))
					{
						xi++;
						nX.push_back(p);
					}
				}
				X=nX;
			}
			if(X.empty())break;
		}
		if(!X.empty())
		{
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
}

#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <algorithm>
#include <functional>
#include <iterator>
#include <locale>
#include <memory>
#include <stdexcept>
#include <utility>
#include <string>
#include <fstream>
#include <ios>
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <streambuf>
#include <complex>
#include <numeric>
#include <valarray>
#include <exception>
#include <limits>
#include <new>
#include <typeinfo>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdlib>
#include <cstddef>
#include <cstdarg>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <cwchar>
#include <cwctype>
using namespace std;
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
using ll = long long;
using ull = unsigned long long;

#define ALL(c) (c).begin(), (c).end()
#define CLEAR(v) memset(v,0,sizeof(v))
#define MP(a,b) make_pair((a),(b))
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ABS(a) ((a)>0?(a):-(a))
template<class T> T MIN(const T& a, const T& b) { return a < b ? a : b; }
template<class T> T MAX(const T& a, const T& b) { return a > b ? a : b; }
template<class T> void MIN_UPDATE(T& a, const T& b) { if (a > b) a = b; }
template<class T> void MAX_UPDATE(T& a, const T& b) { if (a < b) a = b; }

constexpr int mo = 1000000007;
int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int N;
vector<complex<double>> S;
vector<complex<double>> T;

bool check(int from, int to) {
	vector<complex<double>> TT;
	complex<double> offset = T[from];
	double theta = arg(T[to] - T[from]);
	for (auto p : T) {
		p -= offset;
		p /= polar(1.0, theta);
		TT.push_back(p);
	}

	for (int i = 0; i < N; ++i) {
		bool found = false;
		for (int j = 0; !found && j < N; ++j) {
			if (abs(S[i] - TT[j]) < EPS) {
				found = true;
			}
		}

		if (!found) {
			return false;
		}
	}
	return true;
}

int main() {
	std::ios::sync_with_stdio(false);

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

	REP(n, N) {
		double a, b;
		cin >> a >> b;
		S.emplace_back(a, b);
	}
	complex<double> offset = S[0];
	double theta = arg(S[1] - S[0]);
	for (auto& p : S) {
		p -= offset;
		p /= polar(1.0, theta);
	}

	REP(n, N) {
		double c, d;
		cin >> c >> d;
		T.emplace_back(c, d);
	}

	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (i == j) {
				continue;
			}

			if (check(i, j)) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}
