/****Bismillahir rahmanir rahim****/

#include<bits/stdc++.h>

using namespace std;

typedef long long            ll;
typedef long double          ld;
typedef vector<int>          vi;
typedef vector<long long>    vl;
typedef vector<double>       vd;

#define All(a) a.begin(),a.end()

template <typename T>
void get_vector(T &a)
{
    for(auto &e: a) cin >> e;
}

template <typename T>
void put_vector(T a)
{
    for(auto e :a)cout << e << " ";
    cout << endl;
}


int main()
{
    int n;
    cin >> n;
    vd a(n),b(n),c(n),d(n);
    int x = 0,y = 0;
    for(int i = 0 ;i <n; i++)
    {
        cin >> a[i]>>b[i];
        x += a[i];y += b[i];
        a[i]*=n;b[i]*=n;
    } 
    for(int i = 0; i<n ; i++)
    {
        a[i] -= x; b[i]-= y;
    }x = 0, y = 0;
    for(int i = 0 ;i <n; i++)
    {
        cin >> c[i]>>d[i];
        x += c[i];y += d[i];
        c[i]*=n;d[i]*=n;
    } 
    for(int i = 0; i<n ; i++)
    {
        c[i] -= x; d[i]-= y;
    }
    double X,Y;
    for(int i=0; i<n; i++){
        if(a[i]!=0 || b[i]!=0){
            swap(a[i],a[0]);
            swap(b[i],b[0]);
        }
    }
    X = a[0];
    Y = b[0];
   // put_vector(a); put_vector(b);put_vector(c);put_vector(d);
    //cout << "x = " << X << " Y = " << Y << endl;
    const double diff = 1e-6;
    string ans = "No";
    for(int i = 0; i <n;i++)
    {
        double angle = atan2(d[i],c[i]) - atan2(Y,X);
        bool ok = true;
        for(int j = 0; j<n; j++)
        {
            double cx = a[j]*cos(angle) - b[j]*sin(angle);
            double cy = a[j]*sin(angle) + b[j]*cos(angle);
            bool ok2 = false;
            for(int k = 0; k<n; k++)
            {
                if(abs(cx-c[k])<=diff&&abs(cy-d[k])<=diff)ok2 = true;
            }
            ok &= ok2;
        }

        if(ok)ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

/*
 ______________________     _______ _______ _______ _______ 
(  ____ \__   __(  __  \   (  ____ |  ___  |  ____ (  ___  )
| (    \/  ) (  | (  \  )  | (    )| (   ) | (    \/ (   ) |
| (_____   | |  | |   ) |  | (____)| (___) | (_____| (___) |
(_____  )  | |  | |   | |  |     __)  ___  (_____  )  ___  |
      ) |  | |  | |   ) |  | (\ (  | (   ) |     ) | (   ) |
/\____) |__) (__| (__/  )  | ) \ \_| )   ( /\____) | )   ( |
\_______)_______(______/___|/   \__//     \_______)/     \|
                      (_____)
One day I will be Candidate Master on Codeforces
I didn't come this far to only come this far */
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define fe(i, a, b) for (int i = a; i <= b; i++)
#define fl(i, a, b) for (int i = a; i < b; i++)
#define vi vector<int>
#define e1(a) int a; cin>>a;
#define e2(a,b) int a,b; cin>>a>>b;
#define e3(a,b,c) int a,b,c; cin>>a>>b>>c;
#define av(arr,n) vector<int> arr(n); fl(i,0,n) cin>>arr[i];
#define aa(arr,n) int arr[n]; fl(i,0,n) cin>>arr[i];
#define es(s) string(s); cin >> (s);
#define rz resize
#define sz(s) s.size()
#define mod 1000000007
#define ff first
#define ss second
#define tn -10e15
#define bg 10e15
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define mii map<int,int>
#define st(a, n) memset(a, n, sizeof(a))
#define vl(n) cout << n << "\n"
#define vs(n) cout << n << " "
#define el cout<<"\n"
#define vn(n) cout << n
#define dsc greater<int>()
#define ps(x,y)  fixed<<setprecision(y)<<x
#define R return
#define B break
#define C continue
#define YC cout<<"YES"<<"\n"
#define YS cout<<"Yes"<<"\n"
#define NC cout<<"NO"<<"\n"
#define NS cout<<"No"<<"\n"
#define lcm(a,b) (a/__gcd(a,b))*b
#define pa(a) for(auto e:a)cout<<e<<" "
const int N = 4e5 + 5;

void solve()
{
    e1(n);
    aa(a, n);
    vi f(202, 0);
    vi f2(202, 0);
    fl(i,0,n){
        if(a[i]>0)
        f[abs(a[i])]++;
        else
        {
            f2[abs(a[i])]++;
        }
    }
    int ans = 0;
    fl(i,0,n){
        int x = a[i];
        fe(j,0,201){
            if(f[j]>0){
            int p = abs(x - j);
            p *= p;
            ans += p * f[j];
            }
        }
        fe(j, 0, 201)
        {
            if(f2[j]>0){
            int p = abs(x + j);
            p *= p;
            ans += p * f2[j];
            }
        }
    }
    vl(ans/2);
}

int32_t main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    solve();

    return 0;
}