#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
using namespace std;

typedef long long ll;
const int MAXN=5e5+5;

template<typename T> void chkmax(T& x,T y){if(y>x)x=y;}
template<typename T> void chkmin(T& x,T y){if(y<x)x=y;}

bool equal(double a,double b){return fabs(a-b)<1e-7;}

int N;
struct node{
	double x,y;
	bool operator<(const node& t)const{
		if(equal(x,t.x))return y<t.y;
		return x<t.x;
	}
	double len(){return sqrt(x*x+y*y);}
}a[MAXN],b[MAXN],c[MAXN],d[MAXN];
double dot(node a,node b){return a.x*b.x+a.y*b.y;}
double cross(node a,node b){return a.x*b.y-a.y*b.x;}

int main(){
	#ifndef ONLINE_JUDGE
	freopen("classic1.in","r",stdin);
	freopen("classic1.out","w",stdout);
	#endif
	scanf("%d",&N);int x,y;
	if(N==1){puts("Yes");return 0;}
	for(int i=1;i<=N;++i)scanf("%d%d",&x,&y),a[i].x=x,a[i].y=y;
	for(int i=2;i<=N;++i)a[i].x-=a[1].x,a[i].y-=a[1].y;a[1].x=a[1].y=0;
	for(int i=1;i<=N;++i)scanf("%d%d",&x,&y),b[i].x=x,b[i].y=y;
	for(int i=1;i<=N;++i){
		for(int j=1;j<=N;++j)if(j!=i)b[j].x-=b[i].x,b[j].y-=b[i].y;b[i].x=b[i].y=0;
		for(int j=1;j<=N;++j)d[j].x=b[j].x,d[j].y=b[j].y;
		sort(d+1,d+N+1);
		for(int j=1;j<=N;++j)if(j!=i&&equal(a[2].len(),b[j].len())){
			double sintheta=cross(a[2],b[j])/(a[2].x*a[2].x+a[2].y*a[2].y);
			double costheta=dot(a[2],b[j])/(a[2].x*a[2].x+a[2].y*a[2].y);
			for(int k=1;k<=N;++k){
				c[k].x=a[k].x*costheta-a[k].y*sintheta;
				c[k].y=a[k].x*sintheta+a[k].y*costheta;
			}
			sort(c+1,c+N+1);bool flag=1;
			for(int k=1;k<=N;++k)if(!equal(c[k].x,d[k].x)||!equal(c[k].y,d[k].y)){flag=0;break;}
			if(flag){puts("Yes");return 0;}
		}
	}
	puts("No");
	return 0;
}
#include <bits/stdc++.h>

/*...
  ...
  author 
  @
  Aman Kothari
  .....
  .....*/

using namespace std;
#define ll long long
#define dl double

/* Sieve Of Erasthosis to find least prime factor */

vector<ll> least_prime(1000001, 0); 
void leastPrimeFactor(ll n) 
{ 
	least_prime[1] = 1; 
	for (ll i = 2; i <= n; i++) 
	{ 
		if (least_prime[i] == 0) 
		{ 
			least_prime[i] = i; 
			for (ll j = 2*i; j <= n; j += i) 
				if (least_prime[j] == 0) 
				least_prime[j] = i; 
		} 
	} 
} 


/* Sieve Of Erasthosis to check if number is a prime number */

bool prime[1000000+1]; 

void isprime(ll n) 
{ 
  memset(prime, true, sizeof(prime)); 
    prime[1]=false;
    for (ll p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (ll i=p*p; i<=n; i += p) 
                prime[i] = false; 
        }
    } 
} 


/* Modular exponentiation */

ll power(ll x, ll y,ll p)  
{  
    ll res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  


/* Variable declaration */

map<char,ll> mc;
map<ll,ll> ml;
vector<ll> v;
vector<char> vc;

void clean(){
	v.clear();
	vc.clear();
	mc.clear();
	ml.clear();
}


ll mod=1000000007;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //leastPrimeFactor(1e6);
    // isprime(1e6);
    ll tc;
    //cin>>tc;
    tc=1;
    ll n=0,k=0;
    string s;
    while(tc--){
		clean();
    	cin>>n;
		ll b[n],a[n];
		for(ll i=0;i<n;i++){
			cin>>a[i]>>b[i];
		}
		ll ans=0;
		for(ll i=0;i<n;i++){
			// cout<<i<<"\n";
			ll temp=(((b[i]-a[i]+1))*(a[i]+b[i]))/2;
			// cout<<a[i]<<" "<<b[i]<<" "<<temp<<"\n";
			ans+=temp;
		}
		cout<<ans<<'\n';
    }
    return 0;
}