#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int a[3];
    cin >> a[0] >> a[1] >> a[2];

    sort(a, a+3);
    if(a[0]==a[1]){
    	cout << a[2] <<endl;
    }else if(a[1]==a[2]){
    	cout << a[0] <<endl;
    }else{
    	cout << 0 <<endl;
    }
  	return 0;
}

#define _DEBUG
#include "bits/stdc++.h"
//#include <atcoder/all>
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,a5,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#define debug_6(x1,x2,x3,x4,x5,x6) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<", "#x6<<": "<<x6<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug_6,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif
#define rep(index,num) for(int index=0;index<(int)num;index++)
#define rep1(index,num) for(int index=1;index<=(int)num;index++)
#define brep(index,num) for(int index=(int)num-1;index>=0;index--)
#define brep1(index,num) for(int index=(int)num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define prind(argument) cout<<std::fixed<<setprecision(13)<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define PI acosl(-1)
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define puba emplace_back
#define pubamp(a,b) emplace_back(mp(a,b))
typedef long long ll;
typedef long double ld;
using namespace std;
//using namespace atcoder;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	int x1[101],y1[101],x2[101],y2[101];
	scan(N);
	rep(i,N){
		scan(x1[i]>>y1[i]);
	}
	rep(i,N){
		scan(x2[i]>>y2[i]);
	}
	if(N==1){
		prin("Yes");
		return 0;
	}
	int a01x=x1[1]-x1[0],a01y=y1[1]-y1[0];
	map<pint,int> acount;
	rep(i,N){
		int atox=x1[i]-x1[0],atoy=y1[i]-y1[0];
		int naiseki=a01x*atox+a01y*atoy;
		int gaiseki=a01x*atoy-atox*a01y;
		acount[mp(naiseki,gaiseki)]++;
	}
	rep(ii,N){
		rep(jj,N){
			if(ii==jj) continue;
			int b01x=x2[ii]-x2[jj],b01y=y2[ii]-y2[jj];
			map<pint,int> bcount;
			rep(i,N){
				int btox=x2[i]-x2[jj],btoy=y2[i]-y2[jj];
				int naiseki=b01x*btox+b01y*btoy;
				int gaiseki=b01x*btoy-btox*b01y;
				bcount[mp(naiseki,gaiseki)]++;
			}
			bool ok=1;
			for(const auto& fs:acount){
				if(bcount[fs.first]!=fs.second){
					ok=0;
				}
			}
			if(ok){
				prin("Yes");
				return 0;
			}
		}
	}
	prin("No");
	return 0;
}
