#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); (i)++)
#define per(i, n) for (ll i = n - 1; i >= 0; (i)--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define ROF(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define ALL(x) std::begin(x), std::end(x)
#define rALL(x) std::rbegin(x), std::rend(x)
#define fi first
#define se second
typedef long long ll;

inline ll cross(ll x1, ll y1, ll x2, ll y2) { return x1 * y2 - x2 * y1; } // (x1, y1)と(x2, y2)の外積, 1->2で反時計回りなら正
inline ll dot(ll x1, ll y1, ll x2, ll y2) { return x1 * x2 + y1 * y2; } // (x1, y1)と(x2, y2)の内積
inline ll norm2(ll x, ll y) { return x * x + y * y; } // ノルム二乗
inline ll cross(pair<ll, ll> a, pair<ll, ll> b) { return a.fi * b.se - a.se * b.fi; }
inline ll dot(pair<ll, ll> a, pair<ll, ll> b) { return a.fi * b.fi + a.se * b.se; }
inline ll norm2(pair<ll, ll> a) { return a.fi * a.fi + a.se * a.se; }

int main(){
    //input, initialize
    ll N; cin >> N;
    vector<ll> a(N), b(N), c(N), d(N);
    //solve
    if(N == 1){ cout << "Yes"; return 0; }
    rep(i, N) cin >> a[i] >> b[i];
    rep(i, N) cin >> c[i] >> d[i];
    rep(i, N) { a[i] *= N; b[i] *= N; c[i] *= N; d[i] *= N; }

    ll c1x, c1y, c2x, c2y; c1x = c1y = c2x = c2y = 0;
    rep(i, N) { c1x += a[i]; c1y += b[i]; c2x += c[i]; c2y += d[i]; }
    c1x /= N; c1y /= N; c2x /= N; c2y /= N;
    rep(i, N) { a[i] -= c1x; b[i] -= c1y; c[i] -= c2x; d[i] -= c2y; }
    
    if(a[0] == 0 && b[0] == 0){
        swap(a[0], a[1]); swap(b[0], b[1]);
    }
    set<pair<ll, ll>> p1, p2; // 外積, 内積の順
    rep(i, N){
        p1.insert(make_pair(cross(a[0], b[0], a[i], b[i]), dot(a[0], b[0], a[i], b[i])));
    }
    rep(i, N){
        p2 = {};
        if(c[i] == 0 && d[i] == 0) continue;
        rep(j, N){
            p2.insert(make_pair(cross(c[i], d[i], c[j], d[j]), dot(c[i], d[i], c[j], d[j])));
        }
        if(p1 == p2) {cout << "Yes" << '\n'; return 0;}
    }
    //output
    cout << "No\n";
    //debug
}
#include "bits/stdc++.h"
 #pragma GCC optimize "trapv"

#define int long long int
#define For(i,a,b) for(int  i=a;i<b;i++)

#define pb push_back
#define endl "\n"

#define drink_boost ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

#define TEST_CASE int  t;cin>>t;while(t--)
#define debug(...) cout<<#__VA_ARGS__<<" = "; print(__VA_ARGS__);

using namespace std;
const int MOD = 1e9 + 7;

void print()  {    cout<<endl;  }
void printArray()  {    return;  }
void read() { return; }

template<typename T , typename... Args>  void print(T a , Args... arg)    {    cout << a << " " ;    print(arg...);    }

template<typename T , typename... Args> void read(T &a , Args&... arg) {   cin >> a;   read(arg...);   }

template<typename T,typename... Args> void read(vector<T>&v , Args&... arg) {  for(auto &i : v)  cin>>i;  read(arg...);  }

template<typename T,typename... Args> void printArray(vector<T>&v, Args&... arg) {   for(auto i : v)     cout<<i<<" ";   cout<<endl;  printArray(arg...);    }

int power(int a,int b) { int  res=1; while(b) { if(b&1LL) res=res*a; b>>=1LL; a=a*a; } return res; }

int modPower(int a,int b) { int res=1; while(b) { if(b&1L) res=(res%MOD*a%MOD)%MOD; b>>=1; a=(a%MOD*a%MOD)%MOD; } return res; }

int gcdExtended(int a,int b,int *x,int *y){ if(a==0) { *x=0,*y=1; return b; } int x1,y1; int gcd=gcdExtended(b%a,a,&x1,&y1); *x=y1-(b/a)*x1; *y = x1; return gcd; }

int modInverse(int b,int m) {int x,y; int g=gcdExtended(b,m,&x,&y); if (g != 1) return -1; return (x%m + m) % m; }

int modDivide(int a,int b,int m=MOD) { a=a%m; int inv=modInverse(b,m); if(inv==-1) return -1; else return (inv*a)%m; }


void runCase_()
{
    int n;
    read(n);
    int x,y,ans = 0;
    while(n--)
    {
        read(x,y);
        int s = (y*(y+1))/2 - (x * (x - 1))/2;
        ans += s;
    }
    print(ans);
}


signed main()
{
    drink_boost;
//    TEST_CASE
    runCase_();
    return 0;
}

/** TEST CASES HERE **/
/*

*/

